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

PoC: Move persisted request processing to injectable class #303

Conversation

blueo
Copy link
Contributor

@blueo blueo commented Oct 7, 2020

This is only an idea that I'd like to develop further but looking for a bit of feedback on approach.

the motivation comes from setting up https://github.com/apollographql/apollo-link-persisted-queries which seems to be a common client library to use for persisted queries. Currently, Controller.php expects any GET request with a persisted query ID to supply that as a query param named id. By default apollo-link-persisted-queries has a different structure (a param that looks like &extensions={"persistedQuery":{"version":1,"sha256Hash":"e2d83966...)

so the thought is to move the extraction of the query ID (and probably fetching the query from ID too) into an Injectable class so that different implementations can more easily created/added.

If this looks reasonable I can also move the default query/variable logic into a similar class and add one to support apollo-link-persisted-queries

@blueo blueo force-pushed the pulls/master/schemageddon-persisted-query-requests branch from 417736f to 554d873 Compare November 24, 2020 21:58
@blueo blueo force-pushed the pulls/master/schemageddon-persisted-query-requests branch from 554d873 to cd3fd16 Compare December 10, 2020 07:51
@unclecheese unclecheese merged commit d628e9d into silverstripe:master Dec 10, 2020
@blueo blueo deleted the pulls/master/schemageddon-persisted-query-requests branch December 10, 2020 20:34
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

Successfully merging this pull request may close these issues.

2 participants