Automatic support for many-to-many fields through linked node creation in source plugins
See original GitHub issueSo in the last few days I tried to get only Wordpress posts with a passed variable (id of a category)… I am creating category sites in gatsby-node, which uses my category template.
Is there a simple way in GraphQL to filter after categories with this plugin? Categories is the only node which is not selectable in the GraphiQL Editor…
{
allWordpressPost(filter: {categories is not here}) {
edges {
node {
id
categories {
id
}
}
}
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
AI Search reference - Product Documentation | ServiceNow
These reference topics provide additional information about AI Search installed components, system properties, features, and forms.
Read more >Many-to-many relationships - Django documentation
To define a many-to-many relationship, use ManyToManyField . What follows are examples of operations that can be performed using the Python API facilities....
Read more >NetSuite Applications Suite - Custom Plug-in Overview
Install Node.js · Install Gulp.js · Developer Tool Roles and Permissions · Create a Custom Role with Fetch and Deploy Permissions · Assign...
Read more >Understanding & Using Relations in Strapi
In this article, we will look into the relational fields in Strapi to ... Strapi is an open-source Node.js headless CMS (Content Management ......
Read more >Customizing the GraphQL Schema - Gatsby
Table of Contents. Explicitly defining data types. The Node interface; Automatic type inference. Creating type definitions. Fixing field types; Opting out of ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Would love to help someone through a PR to add support for filtering on linked nodes 👍
This is a limitation of how you can query many-to-many fields in GraphQL with Gatsby – we don’t automatically create two-way Connection links between nodes pulled in by some plugins, which is required to do the type of querying you discuss.
This would be a bit of a complicated PR and should happen in gatsby core rather than the Wordpress source plugin; feel free to dive in if you’d like.
https://github.com/gatsbyjs/gatsby/blob/57f7b0d372a7461f019ce86a9003371d45204f3b/packages/gatsby/src/schema/build-node-connections.js