Skip to content
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

Automatic Persisted Queries #734

Merged
merged 6 commits into from
Jun 24, 2019
Merged

Automatic Persisted Queries #734

merged 6 commits into from
Jun 24, 2019

Conversation

DBL-Lee
Copy link
Contributor

@DBL-Lee DBL-Lee commented Jun 1, 2019

This PR implements automatic persisted queries as described here

It follows apollo server implementation here to make sure it is compatible with apollo clients.

This have been running in our production environment for a few weeks and works well with Apollo client with APQ enabled.

This implements #401

I have:

  • Added tests covering the bug / feature (see testing)
  • Updated any relevant documentation (see docs)

Copy link
Contributor

@radev radev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implementation will work only with single graphql server instance or sticky sessions.
With load-balancing follow-up query can land on a different server, so it will take some until all servers will receive APQ hash.

I would suggest doing interface to support pluggable implementation (e.g. shared redis cache).

I would suggest doing interface to support pluggable implementation

handler/graphql.go Outdated Show resolved Hide resolved
@radev
Copy link
Contributor

radev commented Jun 12, 2019

See DBL-Lee#1 for proposed implementation

DBL-Lee added 2 commits June 12, 2019 15:04
Support for external APQ cache
Copy link
Contributor

@radev radev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@assimelha
Copy link

this looks solid 👍

@vektah vektah merged commit cb284c5 into 99designs:master Jun 24, 2019
@vektah
Copy link
Collaborator

vektah commented Jun 24, 2019

Thanks for the PR. I gave it a test run on one of our projects, docs are good, everything seems to work.

The handler package is becoming a bit big, we will have to do something to make it a bit more modular in the future.

@vektah vektah added the v0.9.1 fixed in v0.9.1 label Jun 27, 2019
cgxxv pushed a commit to cgxxv/gqlgen that referenced this pull request Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v0.9.1 fixed in v0.9.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants