Explore your schema
Explore your CMS 12 schema, view available content types, and test basic queries using Graph.
Use the provided GraphQL queries to explore the structure of your Content Management System (CMS) content and understand how it maps to the Optimizely Graph schema. These examples help you examine available content types, test queries, and validate filtering or search behavior. For a detailed overview of how the schema defines content relationships and field structures, see Optimizely Graph Schema.
NoteYour available content types may vary depending on your CMS configuration and custom schema definitions.
Get types in your schema
Each Optimizely Graph instance has a unique schema that defines the available content types and fields.
To explore your schema, start with the following query:
# See available content types
query GetContentTypes {
__schema {
types {
name
description
}
}
}
To view the structure of a specific content type, such as ArticlePage, run the following query:
# Explore a specific content type
query ExploreArticlePage {
__type(name: "ArticlePage") {
fields {
name
type {
name
}
}
}
}
Find your content
Use the following query to list content types and their total counts. Update the query with the content types available in your schema.
# Get content types and their counts
query ContentInventory {
ArticlePage { total }
StandardPage { total }
ProductPage { total }
# Add your content types here
}
Test basic queries
Run simple queries to retrieve content and test your configuration.
# Simple list query
query SimpleList {
ArticlePage(limit: 3) {
items {
Name
RelativePath
}
}
}
To filter results, use a where clause.
# Query with filtering
query FilteredList {
ArticlePage(
where: { TeaserText: { contains: "Alloy" } }
limit: 5
) {
items {
Name
TeaserText
}
}
}
Updated 20 days ago
