neo4j-graphql / neo4j-graphql

GraphQL bindings for Neo4j, generates and runs Cypher
https://grandstack.io/docs/neo4j-graphql-plugin.html
Apache License 2.0
450 stars 71 forks source link

bug: root query type is named `QueryType` instead of `Query` #144

Open jorroll opened 6 years ago

jorroll commented 6 years ago

At the moment, neo4j-graphql appears to place auto-generated root fields in a special QueryType type. It's unclear if this is a bug or intentional. As shown in the spec, the root level query type is expected to have the form:

type Query {
  # ...
}

Using introspection on the auto-generated schema, it does not appear as though there is a root level Query type.

Update

I probably misspoke: fields have levels to them, but type definitions do not. The schema object has query and mutation root fields, its just that those fields are typed incorrectly. In addition to being unconventional (spec breaking?), this also impacts schema stitching.

jorroll commented 6 years ago

Hmm, looking at some of the tests, looks like same goes for MutationType as well.

jorroll commented 6 years ago

Oops, looks like I'm wrong in saying that the current format breaks the spec. The spec has an example with type MyQueryRootType as the root query type.

While I'm still confident in saying that the current name is unconventional (I can't remember ever seeing a root query type not named Query), I'm going to close this issue.

It's causing issues with my schema stitching, but it sounds like I should figure out another way to solve the issues as this behavior is valid.

jexp commented 6 years ago

We can easily fix it. No problem. Thanks for the feedback.

Btw. sorry for the silence on your other issues, there is a lot going on with GraphConnect I pick it up again after next week.

jorroll commented 6 years ago

No worries! I actually saw that GraphConnect was happening and figured I wouldn't hear from anyone for a week or two 👍