When I run the server using code-first approach I get the following error. Using the schema-first approach it is working as expected.
/Users/laurent/users-application/node_modules/graphql/type/schema.js:219
throw new Error(
^
Error: Schema must contain uniquely named types but contains multiple types named "Entity".
at new GraphQLSchema (/Users/laurent/users-application/node_modules/graphql/type/schema.js:219:15)
at transformSchema (/Users/laurent/users-application/node_modules/@nestjs/graphql/dist/utils/transform-schema.util.js:22:12)
at GraphQLFederationFactory.overrideOrExtendResolvers (/Users/laurent/users-application/node_modules/@nestjs/graphql/dist/federation/graphql-federation.factory.js:101:60)
at GraphQLFederationFactory.generateSchema (/Users/laurent/users-application/node_modules/@nestjs/graphql/dist/federation/graphql-federation.factory.js:79:33)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at GraphQLFederationFactory.mergeWithSchema (/Users/laurent/users-application/node_modules/@nestjs/graphql/dist/federation/graphql-federation.factory.js:32:22)
at ApolloFederationDriver.start (/Users/laurent/users-application/node_modules/@nestjs/apollo/dist/drivers/apollo-federation.driver.js:19:32)
at GraphQLModule.onModuleInit (/Users/laurent/users-application/node_modules/@nestjs/graphql/dist/graphql.module.js:105:9)
at callModuleInitHook (/Users/laurent/users-application/node_modules/@nestjs/core/hooks/on-module-init.hook.js:51:9)
at NestApplication.callInitHook (/Users/laurent/users-application/node_modules/@nestjs/core/nest-application-context.js:178:13)
Is there an existing issue for this?
Current behavior
When I run the server using code-first approach I get the following error. Using the schema-first approach it is working as expected.
Minimum reproduction code
https://github.com/L-Luciano/graphql-federation-interface
Steps to reproduce
Expected behavior
server starts
Package version
10.0.19
Graphql version
"apollo-server-express": "3.9.0", "graphql": "16.5.0", "graphql-tools": "8.3.0",
"@apollo/federation": "0.36.1", "@apollo/gateway": "2.0.5", "@apollo/subgraph": "2.0.5",
NestJS version
9.0.1
Node.js version
v16.14.0
In which operating systems have you tested?
Other
Interfaces :
Models :
This works with apollo-server packages.
No response