-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Feature: Query multiple node types simultaneously #2775
Comments
This seems like a really valuable area to explore. There's definitely lots of times you want to query multiple types at once like your "content feed" use case. A few ways we could handle this:
People have any other ideas? |
I think automatically inferring might be tricky where as allowing programatic union definition would allow for more control / use cases. For example not everything with a publishDate should appear in my "content feed". Being relatively new to gatsby I don't have a strong feeling on how to expose this functionality |
👍 also someone could easily write a plugin to do the automatic inference. Always better to start low-level and manual in core and then experiment with higher-level primitives in userland. Plugins use hooks so both :-) Probably the best way to land this is to add a PR with the new API hook along with an example site demoing its use and then if there's a really solid plugin that can automate some of this, add that as well. This would be really exciting functionality to add! |
Sounds good. I'm going to try and get something raised early next week 👌 |
Raised something super rough to get feedback #2990 |
Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help! |
I'm using the
gatsby-source-contentful
and would like, in a single query, to be able toorder
andpaginate
several content types simultaneously.The use case for this is a "latest content feed" which co-mingles 3 different content types chronologically based on a
publishDate
field which I've added to each of the CMS content models.I've been reading about GraphQL Unions and Interfaces as a means to dealing with different content types collectively.
I'm keen to know if this is achievable and what the best approach is.
The text was updated successfully, but these errors were encountered: