Skip to content

Persisted queries support#707

Merged
klausi merged 19 commits intodrupal-graphql:8.x-4.xfrom
chindris:persisted_queries
Jul 14, 2020
Merged

Persisted queries support#707
klausi merged 19 commits intodrupal-graphql:8.x-4.xfrom
chindris:persisted_queries

Conversation

@chindris
Copy link
Copy Markdown
Contributor

@chindris chindris commented Jan 8, 2019

The basis for implementing persisted queries, with no specific implementation of it (that will be part of a separate module).

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 8, 2019

Codecov Report

Merging #707 into 8.x-4.x will decrease coverage by 0.56%.
The diff coverage is 29.84%.

Impacted file tree graph

@@              Coverage Diff              @@
##             8.x-4.x     #707      +/-   ##
=============================================
- Coverage      52.69%   52.13%   -0.57%     
- Complexity       635      674      +39     
=============================================
  Files            115      116       +1     
  Lines           1630     1759     +129     
=============================================
+ Hits             859      917      +58     
- Misses           771      842      +71     
Impacted Files Coverage Δ Complexity Δ
src/Form/PersistedQueriesForm.php 0.00% <0.00%> (ø) 18.00 <18.00> (?)
src/PersistedQuery/PersistedQueryPluginBase.php 42.10% <42.10%> (ø) 9.00 <9.00> (?)
src/Entity/Server.php 87.27% <88.63%> (+3.69%) 38.00 <17.00> (+20.00)
src/Plugin/PersistedQueryPluginManager.php 100.00% <100.00%> (ø) 1.00 <1.00> (?)
...n/GraphQL/DataProducer/EntityDefinition/Fields.php 0.00% <0.00%> (ø) 12.00% <0.00%> (ø%)
...L/SchemaExtension/SdlSchemaExtensionPluginBase.php 0.00% <0.00%> (ø) 5.00% <0.00%> (ø%)
...Plugin/GraphQL/DataProducer/User/PasswordReset.php
src/GraphQL/Response/Response.php
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 767e167...756edc8. Read the comment docs.

Copy link
Copy Markdown
Contributor

@fubhy fubhy left a comment

Choose a reason for hiding this comment

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

Hi @chindris! Thanks for the work. One important thing imho from my PoV would be to make this fully configurable per schema. We probably want to come up with a pattern for this that we can then also use for other per-schema things like logging, performance tracing (e.g. a field level performance metric evaluator e.g. for newrelic, etc.)

Comment thread graphql.links.menu.yml Outdated
route_name: entity.graphql_server.collection
parent: system.admin_config_services

graphql.query_maps:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All features (including query maps) should be scoped per Server/Schema. We will need the ability to configure per-schema "features" for other things in the future too so we should come with a pluggable pattern for this.

E.g. one thing we would also build with a pluggable approach would be logging and performance tracing for individual schemas.

Comment thread graphql.services.yml Outdated
- { name: config.factory.override, priority: -253 }

# Query map provider using the composite pattern.
graphql.query_provider:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We might want to make query providers plugins that one can attach to a schema/server.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Think e.g. about Search API and how it makes indexes extendable with facets, processors/transformers, etc.

@pmelab pmelab added the 4.x label Mar 6, 2019
@fubhy
Copy link
Copy Markdown
Contributor

fubhy commented Oct 14, 2019

Thanks for working on this. Feel free to reach out to me on Slack when you have a moment in the next few days to discuss the status of the PR etc. :-)

@rthideaway
Copy link
Copy Markdown
Contributor

@fubhy @pmelab what is the status of it? We'd like to use this feature. Can we somehow help with releasing it?

@klausi
Copy link
Copy Markdown
Contributor

klausi commented Apr 29, 2020

@rthideaway can you do a code review of the pull request?

Travis tests are passing, only the code test coverage % decreases.

This is quite a big change, so we should think about how this could break existing sites that use the graphql module.

We should determine if the test coverage is good enough, and then we could merge?

@rthideaway
Copy link
Copy Markdown
Contributor

@klausi Regarding the test coverage. Persisted query plugin manager and persisted query plugins are tested well.

The missing test coverage relates to PersistedQueriesForm where the persisted query plugins are being enabled, which I would consider not that critical, as the form works by manual testing. The other missing test coverage relates to some of the new methods on Server entity, which couple of them would be covered by covering the form. The rest seems again good based on manual testing.

I would go for the merge.

@klausi
Copy link
Copy Markdown
Contributor

klausi commented Jul 14, 2020

OK I agree, will merge this now.

@klausi klausi merged commit ce01f1b into drupal-graphql:8.x-4.x Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants