Error on duplicate queries/mutations defined in multiple resolvers
Is there an existing issue that is already proposing this?
- [X] I have searched the existing issues
Is your feature request related to a problem? Please describe it
If two more resolvers define a query (or mutation) with same name, I dont get any error or even warning.
const schema = await gqlSchemaFactory.create([
RecipesResolver,
AuthorsResolver,
PostsResolvers,
]);
Describe the solution you'd like
So can we please have a flag to detect duplicate queries/mutations and give errors accordingly?
Teachability, documentation, adoption, migration strategy
No response
What is the motivation / use case for changing the behavior?
Better diagnostics!
Could you please provide a minimum reproduction repository? This will help us to fix & address this issue quicker
Could you please provide a minimum reproduction repository? This will help us to fix & address this issue quicker
The code snippet I have shared in the original post is from the graphql docs itself. Here it is again:
const schema = await gqlSchemaFactory.create([
RecipesResolver,
AuthorsResolver,
PostsResolvers,
]);
In this code, if two or more resolvers define a query (or a mutation) with same name, then the graphql code generator is not designed to give any error as of now. That is my concern. In my opinion, it should give an error.