-
Notifications
You must be signed in to change notification settings - Fork 57
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
not working with root resolvers #1
Comments
@mcollina The first option is expected not to work since we follow https://www.apollographql.com/docs/graphql-tools/resolvers.html. However there should have been a compiling error message. Another QoS improvement we could do, is a normalization for a Query only schema where the root resolvers are wrapped in the Query object. Does that sound good? |
@ruiaraujo the first option is still valid usage of GraphQL.js - the GraphQL engine supports that. Is the goal of this library only to be compatible with Apollo? Note that most of the examples in https://graphql.org/graphql-js/basic-types/ use async functions in the root value. IMHO giving a clear validation error when something is not supported would be of great help, however in this case I think this feature is valid GraphQL and should be supported. i would not normalize, as it might have some side effects. |
That usage is not a resolver, it is using the root object and the default field resolver will call those functions. This does not work with the compiler since the compiler relies on the resolver presence to compile the function. |
I will fix the compiler error in the meantime. |
I'm currently trying to adjust https://github.com/mcollina/fastify-gql to use this.
However, I'm getting stuck on this problem:
This is our source code:
Note that attaching
add
to the query object works.Our integration lives here: https://github.com/mcollina/fastify-gql/tree/jit.
The text was updated successfully, but these errors were encountered: