@labdigital/commercetools-federated-schema
v0.0.3
Published
## Installation
Downloads
3
Keywords
Readme
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;
};