Resources

Ɨ

Visual CMS

Drag-and-drop visual editor and headless CMS for any tech stack

Theme Studio for Shopify

Build and optimize your Shopify-hosted storefront, no coding required

Resources

Blog

Get StartedLogin

ā˜°

Home

Forum

Blog

Github

Login

Signup

Made in Builder

Builder GraphQL Content API

Usage

With the GraphQL Content API you can query your data by targeting attributes and/or custom fields and use your data as you choose!

The format is

You can also use POST requests with { "query": QUERY } as the body, though GET is preferred when possible for performance and caching purposes

Explorer

The best way to explore the GraphQL API for your data is to use the GraphQL explorer:

Try the Graphql explorer

Querying models

Your models appear as fields defined on the root query type. For each model a new field will be defined myCoolModel(...) to fetch paginated results, and oneMyCoolModel(...) to fetch a single record.

For example, if in my space I have the models page, header, and footer, my GraphQL schema's root query type will have the fields page, onePage, footer, oneFooter, header, and oneHeader.

Examples

You can see real world examples of using our GraphQL API in our open source examples, such as our Gatsby example.

All the examples below assume that your space has a model named page defined, but you could swap it out for any other model you have defined.

Basic usage

With targeting

See our content API docs for more info on custom targeting

With query

See our content API docs for more info on custom querying

For React

See our gatsby example for more info about querying and rendering to React

Get HTML

Data model fields

Was this article helpful?