GraphQL doing unnecessary/repetitious requests/resolves.
Problem
Hi, Given the following type language schema: [code block] and the following query: [code block] we see the following requests for data on the backend: [code block] [uids are generated per unique call to `resolve`]. These repetitious requests came as a surprise given that one of GraphQL's biggest selling points is the elimination of N+1 queries and the introduction of intelligent caching/simplification/reduction etc etc etc Is this a known issue?
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: GraphQL doing unnecessary/repetitious requests/resolves.
The biggest problems with optimization currently is that not all parts of the tree are known beforehand, eg due to the way typed fragments work with interface or union resolving. We did this full optimization before graphql-js was released, but we lacked such features in our type system. I believe that it's possible to do some optimization beforehand, though, but I think a more reliable solution a
Trust Score
2 verifications
- 1
The biggest problems with optimization currently is that not all parts of the tr
The biggest problems with optimization currently is that not all parts of the tree are known beforehand, eg due to the way typed fragments work with interface or union resolving. We did this full optimization before graphql-js was released, but we lacked such features in our type system. I believe that it's possible to do some optimization beforehand, though, but I think a more reliable solution at this point is optimization through a query proxy, like described, eg, here https://www.reddit.com/r/reactjs/comments/3flgnu/building_a_graphql_server_with_nodejs_and_sql/ctqudkn
- 2
On Thu, Aug 27, 2015 at 10:19 PM, Lee Byron notifications@github.com
wrote:
- 3
> To be clear - I'm not saying that GraphQL _should not_ contain these optimizat
> > Reply to this email directly or view it on GitHub: > https://github.com/graphql/graphql-js/issues/111#issuecomment-135528516
Validation
Resolved in graphql/graphql-js GitHub issue #111. Community reactions: 1 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep