Query examplesSettings
Settings
These are examples of queries to fetch settings from the wp_options
table.
Fetching settings
Fetch the site's URL, name and description, all of them stored as a single value:
query {
siteURL: optionValue(name: "home")
siteName: optionValue(name: "blogname")
siteDescription: optionValue(name: "blogdescription")
}
Fetch the site's sticky posts, which is stored as an array:
query {
stickyPosts: optionValues(name: "sticky_posts")
}
Fetch some custom option, stored as an object:
query {
themeMods: optionObjectValue(name: "theme_mods_twentytwentyone")
}
Prev
Next