Skip to content

Optimized Query performance / Query reducing #90

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

Closed
JesseFarebro opened this issue Dec 6, 2015 · 2 comments
Closed

Optimized Query performance / Query reducing #90

JesseFarebro opened this issue Dec 6, 2015 · 2 comments

Comments

@JesseFarebro
Copy link

I believe one thing missing from the current graphql-go library is the ability to either defer query execution to batch queries or some method of reducing complex queries so you aren't taking such a performance hit while retrieving items from a database.

Now with the current state of GraphQL there seems to be a couple different ways to do this, I think we can get our own discussion going about how to implement similar functionality in Go and how such an API should look. Once I have a little more of an idea about a finalized API I have no problem sending in a pull request for further review.

I'll link here some current patterns to aid in the discussion:

Scala's primary GraphQL library Sangria has probably the largest implementation of performance enhancing patterns. They have an entire section on deffered values and resolvers. Essentially they have per type batched deferred values so you can perform say, one SQL query to fetch all these values and have the framework still marshall the proper results.

Shopify has made their own library for batching GraphQL requests in Ruby. It can be located here.

Here is the current discussion on the main graphql repository for reducing their executer queries: graphql/graphql-js#26.

@gburt
Copy link

gburt commented Mar 24, 2018

I believe this issue is a duplicate of #106

*Edit: sorry just realized this is #90...so #106 (etc) are all dupes of this :)

@chris-ramon
Copy link
Member

Thanks a lot for the great feedback guys! 👍 — I've created a new repo: graphql-dataloader-sample which shows how to do batching, closing this one.

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

No branches or pull requests

3 participants