0.0.3 • Published 3 years ago
@labdigital/commercetools-federated-schema v0.0.3
Commercetools Schema Federation
Installation
yarn add @labdigital/commercetools-federated-schema
Usage
import { createCommercetoolsSchema } from '@labdigital/commercetools-federated-schema';
let commercetoolsSchema: GraphQLSchema;
export const getCommercetoolsSchema = () => {
if (!commercetoolsSchema) {
commercetoolsSchema = createCommercetoolsSchema({
endpoint: `${process.env.CT_API_URL}/${process.env.CT_PROJECT_KEY}/graphql`,
transforms: transforms,
typeDefs: [commercetoolsTypeDefs],
resolvers: [commercetoolsResolvers],
});
}
return commercetoolsSchema;
};