-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema first code generation creates duplicate IQuery interfaces #2344
Comments
Would you like to create a PR for this issue? |
I can't really wrap my head around the changes made in |
@drieshooghe In this PR (#2081) , I made the change to write schema all at once. Before the change, contents which are added by |
@katainaka0503 would you like to create a PR to fix this issue? Otherwise we might need to revert that PR |
@kamilmysliwiec Yes. I think I can work on this issue by the end of September. |
I've quickly investigated the issue. When For example, schema in the repository is ( https://github.com/drieshooghe/nestjs-graphql-bug ) interpreted by {
"kind": "Document",
"definitions": [
{
"kind": "ObjectTypeDefinition",
"name": {
"kind": "Name",
"value": "Query"
},
"interfaces": [],
"directives": [],
"fields": []
},
{
"kind": "ObjectTypeExtension",
"name": {
"kind": "Name",
"value": "Query"
},
"interfaces": [],
"directives": [],
"fields": [
{
"kind": "FieldDefinition",
"name": {
"kind": "Name",
"value": "bar"
},
"arguments": [],
"type": {
"kind": "NamedType",
"name": {
"kind": "Name",
"value": "Boolean"
}
},
"directives": []
},
{
"kind": "FieldDefinition",
"name": {
"kind": "Name",
"value": "foo"
},
"arguments": [],
"type": {
"kind": "NamedType",
"name": {
"kind": "Name",
"value": "Boolean"
}
},
"directives": []
}
]
}
],
"loc": {
"start": 0,
"end": 79
}
} Simply adding a sqlfile like below fixes the problem type Query , which is interpreted by
@drieshooghe I think this can be a quickfix. @kamilmysliwiec |
After further investigation, I found that this is the problem of Actually this is caused by I made a PR to merge duplicate definition using graphql-tools. |
Let's track this here #2353 |
Is there an existing issue for this?
Current behavior
When using the
GraphQLFederationDefinitionsFactory
to build type declarations based on multiple GraphQL schemas, a duplicate emptyIQuery
interface/class gets added.Minimum reproduction code
https://github.com/drieshooghe/nestjs-graphql-bug
Steps to reproduce
yarn
yarn generate-typings
Expected behavior
The output doesn't contain the duplicate interface/class.
Package version
10.0.21
Graphql version
@apollo/subgraph
: "2.0.5"NestJS version
9.0.11
Node.js version
16.13.1
In which operating systems have you tested?
Other
I think this PR is causing the issue: #2081
The text was updated successfully, but these errors were encountered: