πŸ““

GraphQL

Log in Start free trial β†’

GraphQL API

GraphQL is a modern API language allowing you to efficiently query data from your Fontdue CMS.

A single GraphQL query can fetch anything we've defined in the schema, which provides you total flexibility in how you structure your site templates. Learn about writing GraphQL queries here.

Access your public GraphQL endpoint at:

https://your-site.fontdue.com/graphql

GraphQL Playground

image

Your site comes with a GraphQL playground to explore the API and make sample queries. When logged in to the Fontdue admin, find the link in the Tools menu.

Click on the green Schema button in the upper right to explore fields available to query.

Write queries and execute them in the left panel.

Example

query {
  viewer {
    fontCollections(first: 10) {
      edges {
        node {
          name
          fontStyles {
            name
            sku {
              price {
                amount
                currency
              }
            }
          }
        }
      }
    }
  }
}

GraphQL is a powerful way to query your data. We are driving deep into the data and fetching only the fields we want.

Note on Connections

You'll notice some of the fields like fontCollections resolve to a Connection type. This is primarily used for implementing Pagination, which becomes necessary when your collection grows.

Many lists resolve to an array rather than a Connection (e.g. Viewer.licenses as well as FontCollection.fontStyles). In those cases we do not expect the size of the list to ever require pagination.