Skip to main content

Custom Query Fields

About This Article

This article covers Available data fields for your GraphQL queries where you define exactly which WordPress data fields will be available in your templates. All fields shown must be explicitly queried to become available.

How Custom Query Fields Work

Unlike built-in data sources, custom GraphQL queries give you complete control Pro Feature over which fields are available in your templates.

Single post example

You query what you need:

    {
post {
ID
post_title
featured_image {
file_url
alt_text
}
}
}

Loops Example:

You query what you need:

    {
posts_query (
arguments: { # define what to loop over
post_type: "post"
}
) {
posts { #define fields to make available in template
ID
post_title
featured_image {
file_url
alt_text
}
}
}
}
GraphQL Query Building

This article lists available fields. For detailed GraphQL query syntax and examples, see GraphQL Queries →

Understand the Tables

Table Columns

GraphQL Field - The field name used in your GraphQL query, this what you type in GraphQL editor

Description - What content this field returns when queried

Type - What kind of data this field returns

Template Usage - How to access this field in your templates after querying

Data Types Explained

String - Text content like "How to Build Better Websites" or "https://example.com/my-post"

Int - Whole numbers like post ID 142 or user ID 5

Array - Multiple items that require Collection elements for display

Object - Complex data with nested properties

Mixed - Variable content that depends on your custom field configuration

How to Use This Data

First: Add the field to your GraphQL query

Second: Use the resulting data in templates with square brackets [[custom.field]] or curly brackets {{field}} in Collection loops

Custom query availability - Only fields you explicitly query for will be available in your templates

Post Fields Reference

Assuming your custom data variable was called custom (unlike where built-in is called wp)

Standard Post Fields

GraphQL FieldDescriptionTypeTemplate Usage
IDPost IDInt[[custom.post.ID]] or {{ID}} in loops
post_titlePost titleString[[custom.post.post_title]] or {{post_title}} in loops
post_contentPost contentString[[custom.post.post_content]] or {{post_content}} in loops
post_excerptPost excerptString[[custom.post.post_excerpt]] or {{post_excerpt}} in loops
post_datePublication dateString[[custom.post.post_date]] or {{post_date}} in loops
post_datetimePublication datetimeString[[custom.post.post_datetime]] or {{post_datetime}} in loops
post_modified_dateLast modified dateString[[custom.post.post_modified_date]] or {{post_modified_date}} in loops
post_modified_datetimeLast modified datetimeString[[custom.post.post_modified_datetime]] or {{post_modified_datetime}} in loops
post_statusPost statusString[[custom.post.post_status]] or {{post_status}} in loops
post_typePost typeString[[custom.post.post_type]] or {{post_type}} in loops
post_namePost slugString[[custom.post.post_name]] or {{post_name}} in loops
permalinkPost URLString[[custom.post.permalink]] or {{permalink}} in loops
guidGlobal unique identifierString[[custom.post.guid]] or {{guid}} in loops
.Current post wildcard (all available fields)String{{.}}, in loops only
indexCurrent post order numberString{{index}}, in loops only
GraphQL FieldDescriptionTypeTemplate Usage
featured_image.file_urlImage URLString[[custom.post.featured_image.file_url]] or {{featured_image.file_url}} in loops
featured_image.alt_textAlt textString[[custom.post.featured_image.alt_text]] or {{featured_image.alt_text}} in loops
featured_image.captionImage captionString[[custom.post.featured_image.caption]] or {{featured_image.caption}} in loops
featured_image.titleImage titleString[[custom.post.featured_image.title]] or {{featured_image.title}} in loops
featured_image.descriptionImage descriptionString[[custom.post.featured_image.description]] or {{featured_image.description}} in loops
featured_image.sizesImage size dataMixed[[custom.post.featured_image.sizes]] or {{featured_image.sizes}} in loops

Post Author Fields

GraphQL FieldDescriptionTypeTemplate Usage
post_author.IDAuthor IDInt[[custom.post.post_author.ID]] or {{post_author.ID}} in loops
post_author.user_loginAuthor usernameString[[custom.post.post_author.user_login]] or {{post_author.user_login}} in loops
post_author.display_nameAuthor display nameString[[custom.post.post_author.display_name]] or {{post_author.display_name}} in loops
post_author.first_nameAuthor first nameString[[custom.post.post_author.first_name]] or {{post_author.first_name}} in loops
post_author.last_nameAuthor last nameString[[custom.post.post_author.last_name]] or {{post_author.last_name}} in loops
post_author.user_emailAuthor emailString[[custom.post.post_author.user_email]] or {{post_author.user_email}} in loops
post_author.user_urlAuthor website URLString[[custom.post.post_author.user_url]] or {{post_author.user_url}} in loops
post_author.descriptionAuthor bioString[[custom.post.post_author.description]] or {{post_author.description}} in loops
post_author.avatar_urlAuthor avatar URLString[[custom.post.post_author.avatar_url]] or {{post_author.avatar_url}} in loops
post_author.rolesAuthor rolesArray[[custom.post.post_author.roles]] or {{post_author.roles}} in loops

Custom Fields

GraphQL Field PatternDescriptionTypeTemplate Usage
price: acf_value(name: "price")ACF field with aliasMixed[[custom.post.price]] or {{price}} in loops
sku: meta_value(key: "product_sku")Post meta with aliasMixed[[custom.post.sku]] or {{sku}} in loops
weight: metabox_value(field_id: "weight")MetaBox field with aliasMixed[[custom.post.weight]] or {{weight}} in loops
Custom Fields Reference

Builderius offers full integration with Advanced Custom Fields and Meta Box custom field vendors. For detailed information about supported fields available to you out of the box visit:

For a detailed information about custom query integration visit:

Post Taxonomy Fields

GraphQL FieldDescriptionTypeTemplate Usage
categories_namesPost categories namesString[[custom.post.categories.names]] or {{categories.names}} in loops
categories_linksPost categories linksString[[custom.post.categories.links]] or {{categories.links}} in loops
tags_namesPost tags namesString[[custom.post.tags.names]] or {{tags.names}} in loops
tags_linksPost tags linksString[[custom.post.tags.links]] or {{tags.links}} in loops
categoriesPost categoriesArray{{categories.name}}, in loops only
categoriesPost categoriesArray{{categories.slug}}, in loops only
categoriesPost categoriesArray{{categories.term_id}}, in loops only
tagsPost tagsArray{{tags.name}}, in loops only
tagsPost tagsArray{{tags.slug}}, in loops only
tagsPost tagsArray{{tags.term_id}}, in loops only

User Fields Reference

Standard User Fields

GraphQL FieldDescriptionTypeTemplate Usage
IDUser IDInt[[custom.user.ID]] or {{ID}} in loops
user_loginUsernameString[[custom.user.user_login]] or {{user_login}} in loops
user_emailUser emailString[[custom.user.user_email]] or {{user_email}} in loops
user_urlUser websiteString[[custom.user.user_url]] or {{user_url}} in loops
display_nameDisplay nameString[[custom.user.display_name]] or {{display_name}} in loops
nicknameNicknameString[[custom.user.nickname]] or {{nickname}} in loops
first_nameFirst nameString[[custom.user.first_name]] or {{first_name}} in loops
last_nameLast nameString[[custom.user.last_name]] or {{last_name}} in loops
descriptionUser bioString[[custom.user.description]] or {{description}} in loops
avatar_urlAvatar image URLString[[custom.user.avatar_url]] or {{avatar_url}} in loops
rolesUser rolesArray[[custom.user.roles]] or {{roles}} in loops
capabilitiesUser capabilitiesArray[[custom.user.capabilities]] or {{capabilities}} in loops
.Current user wildcard (all available fields)String{{.}}, in loops only
indexCurrent user order numberString{{index}}, in loops only

User Custom Fields

GraphQL Field PatternDescriptionTypeTemplate Usage
bio: acf_value(name: "bio")ACF user field with aliasMixed[[custom.user.bio]] or {{bio}} in loops
department: meta_value(key: "department")User meta with aliasMixed[[custom.user.department]] or {{department}} in loops
phone: metabox_value(field_id: "phone")MetaBox user field with aliasMixed[[custom.user.phone]] or {{phone}} in loops
Custom Fields Reference

Builderius offers full integration with Advanced Custom Fields and Meta Box custom field vendors. For detailed information about supported fields available to you out of the box visit:

For a detailed information about custom query integration visit:

Term Fields Reference

Standard Term Fields

GraphQL FieldDescriptionTypeTemplate Usage
term_idTerm IDInt[[custom.term.term_id]] or {{term_id}} in loops
nameTerm nameString[[custom.term.name]] or {{name}} in loops
slugTerm slugString[[custom.term.slug]] or {{slug}} in loops
term_groupTerm groupString[[custom.term.term_group]] or {{term_group}} in loops
term_taxonomy_idTerm taxonomy IDInt[[custom.term.term_taxonomy_id]] or {{term_taxonomy_id}} in loops
taxonomyTaxonomy nameString[[custom.term.taxonomy]] or {{taxonomy}} in loops
descriptionTerm descriptionString[[custom.term.description]] or {{description}} in loops
countPost countInt[[custom.term.count]] or {{count}} in loops
parentParent term IDInt[[custom.term.parent]] or {{parent}} in loops
childrenChild termsArray{{children}}
.Current term wildcard (all available fields)String{{.}}
indexCurrent term order numberString{{index}}

Term Custom Fields

GraphQL Field PatternDescriptionTypeTemplate Usage
icon: acf_value(name: "category_icon")ACF term field with aliasMixed[[custom.term.icon]] or {{icon}} in loops
color: meta_value(key: "term_color")Term meta with aliasMixed[[custom.term.color]] or {{color}} in loops
banner: metabox_value(field_id: "banner")MetaBox term field with aliasMixed[[custom.term.banner]] or {{banner}} in loops
Custom Fields Reference

Builderius offers full integration with Advanced Custom Fields and Meta Box custom field vendors. For detailed information about supported fields available to you out of the box visit:

For a detailed information about custom query integration visit:

Archive Fields Reference

Archive Information

GraphQL FieldDescriptionTypeTemplate Usage
titleArchive titleString[[custom.archive.title]]
descriptionArchive descriptionString[[custom.archive.description]]
typeArchive typeString[[custom.archive.type]]
search_keywordSearch term (search archives)String[[custom.archive.search_keyword]]
GraphQL FieldDescriptionTypeTemplate Usage
termArchive term objectObject[[custom.archive.term]]
authorArchive author objectObject[[custom.archive.author]]
posts_queryArchive postsObject[[custom.archive.posts_query.posts]]
GraphQL FieldDescriptionTypeTemplate Usage
IDMenu item IDInt{{ID}}
titleMenu item titleString{{title}}
urlMenu item URLString{{url}}
descriptionMenu item descriptionString{{description}}
classesMenu item CSS classesString{{classes}}
targetLink target attributeString{{target}}
object_idReferenced object IDInt{{object_id}}
childrenChild menu itemsArray{{children}}
.Current item wildcard (all available fields)String{{.}}
indexCurrent item order numberString{{index}}
GraphQL Field PatternDescriptionTypeTemplate Usage
icon: acf_value(name: "menu_icon")ACF menu item fieldMixed{{icon}}
badge: meta_value(key: "menu_badge")Menu item metaMixed{{badge}}
Custom Fields Reference

Builderius offers full integration with Advanced Custom Fields and Meta Box custom field vendors. For detailed information about supported fields available to you out of the box visit:

For a detailed information about custom query integration visit:

Site-Wide Fields Reference

Site Information

GraphQL FieldDescriptionTypeTemplate Usage
option_value(name: "blogname")Site titleString[[custom.site_title]] (if aliased)
option_value(name: "blogdescription")Site taglineString[[custom.site_tagline]] (if aliased)
option_value(name: "siteurl")Site URLString[[custom.site_url]] (if aliased)
current_urlCurrent page URLString[[custom.current_url]]

Utility Functions

GraphQL FieldDescriptionTypeTemplate Usage
url_param: url_parameter(name: "search")URL parameter with aliasMixed[[custom.url_param]]
user_cookie: cookie_parameter(name: "user_pref")Cookie value with aliasMixed[[custom.user_cookie]]
server_info: server_parameter(name: "HTTP_HOST")Server variable with aliasMixed[[custom.server_info]]
calc_result: expression_result(expression: "2 + 2")Expression result with aliasMixed[[custom.calc_result]]
wp_function: php_function_output(function: "wp_get_theme")PHP function output with aliasMixed[[custom.wp_function]]

Site Options & Custom Fields

GraphQL Field PatternDescriptionTypeTemplate Usage
contact_email: acf_value(name: "contact_email")ACF options fieldMixed[[custom.contact_email]]
footer_text: option_value(name: "custom_footer")WordPress optionMixed[[custom.footer_text]]
logo: metabox_value(field_id: "site_logo", option_name: "site_settings")MetaBox options fieldMixed[[custom.logo]]

URL Helper Functions

GraphQL FieldDescriptionTypeTemplate Usage
front_page_urlHomepage URLString[[custom.home_url]] (if aliased)
posts_index_page_urlBlog index URLString[[custom.blog_url]] (if aliased)
page_url(name: "about")Page URL by slugString[[custom.about_url]] (if aliased)
post_url(name: "hello-world")Post URL by slugString[[custom.post_url]] (if aliased)
category_archive_url(slug: "news")Category archive URLString[[custom.news_url]] (if aliased)
author_archive_url(username: "admin")Author archive URLString[[custom.author_url]] (if aliased)

Form Functions

GraphQL FieldDescriptionTypeTemplate Usage
contact_url: form_submission_url(form: "contact")Form action URL with aliasString[[custom.contact_url]]
contact_nonce: form_nonce(form: "contact")Form security nonce with aliasString[[custom.contact_nonce]]

Hook Functions

GraphQL FieldDescriptionTypeTemplate Usage
hook_data: hook_argument(position: 0)WordPress hook argument with aliasMixed[[custom.hook_data]]