Skip to content

Conversation

defr
Copy link

@defr defr commented Dec 3, 2018

Previously, all the queries where exposed straight on the entity type, not taking into account the bundles on which the field actually appears.

This changes it to keep exposing the base fields on the entity type interface, but expose the configurable fields only on the bundles they're attached to.

@codecov
Copy link

codecov bot commented Dec 3, 2018

Codecov Report

Merging #703 into 8.x-3.x will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@              Coverage Diff              @@
##             8.x-3.x     #703      +/-   ##
=============================================
+ Coverage      79.51%   79.53%   +0.02%     
- Complexity      1274     1277       +3     
=============================================
  Files            192      192              
  Lines           3158     3162       +4     
=============================================
+ Hits            2511     2515       +4     
  Misses           647      647
Impacted Files Coverage Δ Complexity Δ
...gin/Deriver/Fields/EntityReferenceQueryDeriver.php 100% <100%> (ø) 11 <0> (+3) ⬆️
src/Routing/QueryRoutes.php 100% <0%> (ø) 3% <0%> (ø) ⬇️

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 a1d8c67...cf2e54f. Read the comment docs.

@defr
Copy link
Author

defr commented Dec 3, 2018

The reverse hunk makes no sense, sorry about that. Fix coming up.

Previously, all the queries where exposed straight on the entity type, not
taking into account the bundles on which the field actually appears.

This changes it to keep exposing the base fields on the entity type interface,
but expose the configurable entity reference fields only on the bundles they're
attached to.
@defr defr changed the title Entity reference: Scope direct and reverse queries Entity reference: Scope direct queries Dec 3, 2018
@defr
Copy link
Author

defr commented Dec 3, 2018

For reverse queries, the situation is more complicated, because each field instance can define its own list of target bundles ; fetching the list of possible target bundles if the entity reference field isn't using the default selection plugin is also going to be problematic. I've reverted that change, and changed the scope of that PR to only be about forward references for now.

@defr defr closed this Dec 3, 2018
@defr defr reopened this Dec 3, 2018
@defr
Copy link
Author

defr commented Dec 3, 2018

Sorry for the misclick

@pmelab pmelab merged commit 3c8b237 into drupal-graphql:8.x-3.x Apr 13, 2019
@pmelab
Copy link
Contributor

pmelab commented Apr 13, 2019

Looks good, thank you very much!

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