Skip to content
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

fix(validation): unnecessary constraint forcing root query type #2422

Conversation

jjangga0214
Copy link
Contributor

@jjangga0214 jjangga0214 commented Feb 3, 2020

Currently, there is a constraint that forces people to provide root query type.

However, IMHO, it's unnecessary.

Mutation-and-subscription-only GraphQL is also possible.

Therefore, I patched it, to allow queryless schema.

More fundamentally speaking, why should you restrict people's intentions?

You cannot predict every use case, as the world is a quite complex place for a limited personal experience and a single philosophy to foresee.

Give people freedom.

JUST LET PEOPLE BUILD WHAT THEY WANT.

Thanks.

@Cito
Copy link
Member

Cito commented Feb 3, 2020

I hate to be a naysayer, but GraphQL.js has been created as a reference implementation for GraphQL, so it needs to follow the specification which says that the type system must contain a query type. Also, I think it is already possible to skip the schema validation by passing assumeValid=true.

@IvanGoncharov
Copy link
Member

@Cito Thanks for the support 👍

@jjangga0214 I totally understand the frustration of being forced to add dummy field to Query type just to satisfy GraphQL specification.
That said as @Cito correctly pointed out we need to follow the spec so a way forward would be to first solve it in the spec.
Moreover, the proposal for this change is discussed here:
graphql/graphql-spec#631

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants