-
Notifications
You must be signed in to change notification settings - Fork 8
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
Optimize nested resolvers #79
Comments
It's interesting if the evaluator can put a fake obj placeholder with partial data (can be based args, such as id), and only it there's a need for obj/parent field that is missing it'll query it. |
I think that's the only way this can work. Otherwise, type Query {
getUser(username: String!): User
@http(url: "user-service/:username")
@provideField(arg: "username", field: "name")`
} It's kind of verbose and I'm not sure how it would behave with different orderings of directives but we can probably make it work. Edit: After sleeping on it, I realized this can still fail if |
More on this: graphql/graphql-js#623 |
Agogos has enough schema information to be able to avoid requesting data it does not need in the case of nested resolvers.
For example, consider this schema:
And this query:
In this case, agogos would call
user-service
andcomment-service
, even though it doesn't need any data fromuser-service
.Agogos has enough information to avoid this, either through Dataloader and more granular resolvers as described here, or resolver-level analysis that can verify which fields are requested and if they have their own resolvers, avoid the top-level request.
The text was updated successfully, but these errors were encountered: