cjoudrey / graphql-schema-linter

Validate GraphQL schema definitions against a set of rules
MIT License
694 stars 62 forks source link

There can be only one type named "Mutation" invalid-graphql-schema #218

Closed guiaramos closed 4 years ago

guiaramos commented 4 years ago

Is it possible to allow multiple Mutation?

cjoudrey commented 4 years ago

Hi @guiaramos, I'm not sure I fully understand what you're asking. Can you share a snippet that is causing this validation error?

cjoudrey commented 4 years ago

Feel free to re-open this if it is still an issue.

guiaramos commented 4 years ago

Sorry for my bad explanation @cjoudrey, I am facing this issue:

/Users/guilhermeramos/Desktop/projects.nosync/snuper/server/src/schemas/Profile/profile.graphql
1:6 There can be only one type named "Query".     invalid-graphql-schema
1:6 There can be only one type named "Query".     invalid-graphql-schema
6:6 There can be only one type named "Mutation".  invalid-graphql-schema
6:6 There can be only one type named "Mutation".  invalid-graphql-schema

but actually it's not a error as we have multiple mutation and query types and then we use mergeType and mergeResolvers from https://github.com/Urigo/merge-graphql-schemas

Is it possible to ignore this error of "There can be only one type Mutation/Query"?

Ty!

cjoudrey commented 4 years ago

Thanks for the clarification @guiaramos! 😄

Here's a similar issue about merge-graphql-schemas: https://github.com/cjoudrey/graphql-schema-linter/issues/147#issuecomment-418152380

Let's continue the discussion there.

Thanks! 😄