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

Allow to explicitly attach to an entity type and / or its bundles. #20

Open
wants to merge 4 commits into
base: 8.x-1.x
Choose a base branch
from

Conversation

das-peter
Copy link

It would be nice if we could extend that automatic detection of "relations" using views arguments to allow to actually configure where a view is attached.
This basically is the EVA approach for GraphQL and quite some code has been borrowed from EVA to create this change.

@eescribanoc
Copy link

I checked this request and it worked since the moment I get the view as a field inside a node, but I have configured a contextual filter to get information from the Content ID from the URL and the contextual filter doesn't work with the default argument provided you need to specify always the contextual filter in the graphql query. I want to achieve to have a content type "Landingspage" and choose which content types to show in a views that I attached using this patch to the Landingspage bundle and I want the view to get the contextual filter of content type from the node ID that is displayed on. I want to create pages with lists of node of bundles where I can choose with a field in the bundle which content types to show. But forcing the contextual filter in the graphql query make the purpose of being dynamic not possible.
I have a view showing related content connected to the same tag as the page you are visiting and that done via a contextual filters and some relations works out of the box, not only displaying the view as a field in the Node but also understanding without setting it in the graphql query the contextual filter needed.

@das-peter das-peter force-pushed the allow-explicit-entity-bundles-attachment branch from 842c338 to dc78c26 Compare January 7, 2020 04:11
@das-peter
Copy link
Author

@eescribanoc The latest patch should go into the direction you were mentioning. The module now supports token arguments & page limit similar to how EVA does that.
This means if the view is attached on an entity, you can use a field on that entity to pre-set arguments.
This allows that an entity (paragraph item) defines how the query has to be executed e.g. by allowing to select tags in the paragraph which will be used as argument in the query.

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