-
-
Notifications
You must be signed in to change notification settings - Fork 916
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 #3118
Automatic Persisted Queries #3118
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3118 +/- ##
==========================================
+ Coverage 84.34% 84.35% +0.01%
==========================================
Files 362 362
Lines 15884 15896 +12
Branches 2579 2583 +4
==========================================
+ Hits 13397 13409 +12
Misses 1871 1871
Partials 616 616
Continue to review full report at Codecov.
|
Protocol here - https://www.apollographql.com/docs/react/api/link/persisted-queries/#protocol (Apollo JS stuff is an implementation). |
/// A Document containing GraphQL Operations and Fragments to execute (required). | ||
/// A Document containing GraphQL Operations and Fragments to execute. | ||
/// It can be null in case of automatic persisted queries (https://www.apollographql.com/docs/apollo-server/performance/apq/) | ||
/// when a client sends only SHA-256 hash of the query given that corresponding key-value pair has been persisted on a server beforehand. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// when a client sends only SHA-256 hash of the query given that corresponding key-value pair has been persisted on a server beforehand. | |
/// when a client sends only SHA-256 hash of the query in <see cref="Extensions"/> given that corresponding key-value pair has been persisted on a server beforehand. |
@Shane32 Note that graphql-over-http spec implicitly says that query field is required |
FYI, the persisted query implementation can easily be done with a custom |
@sungam3r I use something similar to APQ already - but only for logging purposes. Each query is hashed and logged, allowing me to compute statistics for any query over a large period of time with very little database / storage space required. Adding APQ would be rather trivial to implement, and would enhance performance. In v6 of GraphQL we should consider allowing |
This PR is a preparation for implementation of Automatic Persisted Queries (APQ) in a server project PR - graphql-dotnet/server#132. Briefly, in case of APQ, a query field can be omitted, execution of a request will be implemented by means of additional hash field (sha256Hash) which corresponds to the query which has been saved on server side in advance, The request will look this way: