GraphQL requests using the items() field
This section contains a number of sample items() calls to demonstrate how to query content from Tridion Sites, Tridion Docs or both.
- GraphQL request for getting all Components of a certain content type
If your authors give each Component a value for a custom metadata key you created calledcontentType, you can use a GraphQL request to filter by content type. This lets you create, say, a dynamic webpage showing all content of that type. - GraphQL request for getting all pages tagged with a specific Taxonomy Keyword
This sample imagines that you have created a Category called "City" and have created a Taxonomy of Keywords in this Category, representing various cities. - GraphQL request for getting all items across Tridion Sites and Tridion Docs that share the same Keyword
The mashup feature lets you tag Tridion Docs content with the same Keyword specified in a Taxonomy in Tridion Sites, and used to tag Tridion Sites content. - GraphQL request for fetching results in batches (paginated)
You can set a maximum number of results to return for your query, and if you request thecursorproperty back, you can use the cursor to fetch another batch of results, starting from where you left off last time. - GraphQL request for fetching Tridion Docs topics tagged with Keywords from a Tridion Sites Taxonomy
To execute a mashup scenario, fetch Tridion Docs content that has the same Taxonomy Keyword as some Tridion Sites content, then combine the two on a webpage. - GraphQL request for getting Publications containing topics tagged with a specific Keyword
To find out which Publication or Publications contain the content that is tagged with a specific Keyword, execute a specificitems()query. This type of query can be useful in, say, a mashup scenario, where you want to identify the context in which your "mashable" content resides.