GraphQL examples
The following are examples of GraphQL queries that you can use in Sitecore Content Hub.
Query recipes title contains Fruitful
This query returns a list of recipes where the recipe title contains Fruitful.
Query content items for certain taxonomies
This query returns data about a specific content taxonomy, specifically blog posts. The returned data consists of the title and the quote associated with the blog post.
Query content items in a specific collection
This query returns data about a content collection with a specific ID. This data includes an object containing the various content items in that collection.
Query all variants that have localization of en-US
This query returns all content item variants with the en-US localization parameter.
Query all variants from entities in a campaign
This query looks at a campaign with a specific ID, and returns all variants of that campaign.
Query all variants of a content entity
This query looks at an entity with a specific ID, and returns all variants of that entity.
Query draft content items in preview
This query returns all content items that are in the Draft state.
Query where there is more than one content version
This query returns all content items that have more than one version.
Query conditional metadata based on the content type
This query returns content based on the content type (blog or recipe) and the status of the content (draft).
Query URLs and relative URLs for a specific asset
This query returns the public links and relative URLs for a specific asset based on its identifier.
Query all assets and display the associated public links
This query returns the ID and public URLs associated with each available asset.