Explore your schema
Learn how to interact with your GraphQL schema in Content Management System Software as a Service (CMS SaaS)
The following GraphQL queries are used to explore the structure of your Content Management System Software as a Service (CMS SaaS) content and understand how it maps to 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.
1. Explore your content structure
Each SaaS CMS instance has a unique content model. Explore the structure of your instance using the following queries:
# See all available content types (types starting with __ is internal graphql types)
query GetContentTypes {
__schema {
types {
name
description
kind
}
}
}
# Get content by type
query ExploreContent {
_Content(
where: { _metadata: { types: { in: ["LandingPage"] } } }
limit: 5
) {
items {
_metadata {
displayName
types
url { default }
}
}
}
}
2. Find your content types
Run the following query to see the total number of content items for each content type:
# Get all content types and their counts
query ContentInventory {
LandingPage { total }
BlogPostPage { total }
_Content { total }
}3. Test filtering and search
Use filters to narrow content results by type or display name:
# Filter by content type
query FilterByType {
_Content(
where: {
_metadata: {
types: { in: ["LandingPage", "BlogPostPage"] }
}
}
limit: 10
) {
items {
_metadata {
displayName
types
url { default }
}
}
}
}
# Search by display name
query SearchContent {
_Content(
where: {
_metadata: {
displayName: { contains: "Mosey" }
}
}
limit: 5
) {
items {
_metadata {
displayName
types
url { default }
}
}
}
}Updated 16 days ago
