GraphQL
The GraphQL API is a great way to integrate Advanced SEO with your headless front end.
Last updated
The GraphQL API is a great way to integrate Advanced SEO with your headless front end.
Last updated
Enable GraphQL in the addon's config:
The Advance SEO data of your entries and terms is separated into three distinct fields:
Fields | Description |
---|---|
The easiest way to get the data is to use the seo
field on Statamic's existing entries
, entry
, terms
, and term
queries:
The seoMeta
query is an alternative to using the seo
field on the entries
, entry
, terms
, and term
queries.
Get the computed title of an entry:
Get the computed title of the brands
term of the tags
taxonomy in the german
site:
Use the seoDefaults
query to get the default data. The query consists of three fields:
Get the site_name
from the general
site defaults:
Get the data from the german
site:
Get the title
from the pages
collection defaults:
Get the data from the german
site:
Get the title
from the tags
taxonomy defaults:
Get the data from the german
site:
Use the seoSitemaps
query to get the data of your collection, taxonomy, and custom sitemaps. The query consists of three fields sharing the same structure:
Get the loc
of all collection, taxonomy, and custom sitemaps:
Argument | Type | Description |
---|---|---|
Fields | Description |
---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Fields | Description |
---|---|
Argument | Type | Description |
---|---|---|
computed
Contains computed fields like the title
, hreflang
, or indexing
raw
Contains the augmented data of the SEO blueprint fields
views
Contains the rendered Advanced SEO head
and body
views
id
String!
The ID of the entry/term to query
site
String
Specify the site of your entry/term. This is only necessary when dealing with a term, as the term's ID isn't unique per site. But it can also be helpful if you want to get an entry in a different site.
site
Get site defaults like site_name
and default og_image
collection
Get the defaults of a specific collection
taxonomy
Get the defaults of a specific taxonomy
site
String
Specify the site of the returned data
handle
String!
The handle of the collection to query
site
String
Specify the site of the returned data
handle
String!
The handle of the taxonomy to query
site
String
Specify the site of the returned data
collection
Get the collection sitemaps
taxonomy
Get the taxonomy sitemaps
custom
Get the custom sitemaps
baseUrl
String
Change the base URL of your sitemap data.
handle
String
Filter the sitemaps by handle of their collection, taxonomy, or custom sitemap.
site
String
Filter the data by site.