Hello NestJS people.
Following the docs for Generating SDL: https://docs.nestjs.com/graphql/generating-sdl i'm getting an error when trying to print the subgraph schema with printSubgraphSchema from @apollo/subgraph.
Looking at the code implementation of GraphQLSchemaBuilderModule , seems that only GraphQLSchemaFactory is available, but not GraphQLFederationFactory
Is there some way to inject the GraphQLFederationFactory and/or the ApolloFederationDriver somehow to the GraphQLSchemaBuilderModule ? Or there is some other way to get the subgraph schema currently without fully starting the service?
Now it seems only federation v1 is support by default and i'm getting the following error
GraphQLError: Unknown directive "@shareable". If you meant the "@shareable" federation 2 directive, note that this schema is a federation 1 schema. To be a federation 2 schema, it needs to @link to the federation specifcation v2.
at withModifiedErrorNodes (/node_modules/@apollo/federation-internals/src/error.ts:174:10)
at withNodeAttachedToError (/node_modules/@apollo/federation-internals/src/buildSchema.ts:306:43)
at buildAppliedDirectives (/node_modules/@apollo/federation-internals/src/buildSchema.ts:341:5)
at buildNamedTypeInner (/node_modules/@apollo/federation-internals/src/buildSchema.ts:446:3)
at buildSchemaFromAST (/node_modules/@apollo/federation-internals/src/buildSchema.ts:158:5)
at buildSubgraph (/node_modules/@apollo/federation-internals/src/federation.ts:1250:27)
at printSubgraphSchema (/node_modules/@apollo/subgraph/src/printSubgraphSchema.ts:16:33)
at generateSchema (/src/generate.schema.ts:114:34) {
Any ideas for implementation, maybe some workaround with custom GraphQLFederationSchemaBuilderModule? or somehow extend GraphQLSchemaBuilderModule?
Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).