Objects

Objects in GraphQL represent the resources that you can access. Objects can contain a list of fields, which are specifically typed. For example, the Product object has a field called handle, which is a String.

For more information, see the GraphQL spec.

The Storefront API uses a set of root nodes that can be queried directly, listed below.

Node Description
Checkout Represents an object used to manage a user’s Cart as it transitions to a paid order.
Collection Represents a grouping of products that a shop owner can create to organize them or make their shops easier to browse.
Mailing Address The mailing address of the customer.
Order A customer's completed request to purchase one or more products from a shop.
Payment Represents a payment amount applied to a checkout.
Product Represents an individual item for sale in a Shopify store.
Product Options Custom product property names.
Product Variant Represents a different version of a product, such as differing sizes or differing colors.
Shop Policy Policy that a merchant has configured for their store, such as their refund or privacy policy.

In the Storefront API, root nodes such as a Checkout can be queried for and the connections with other objects can be specified using connections. Using connections provides a way to get all of the nodes that are connected to another node in a specific way.

For example, Collections is a root node in the Storefront API that implements the Node interface. It can be queried for using the products connection. A products connection includes an argument specifying to only return the first five related products. The node block specifies that the id and handle should be returned for each product.

{
  shop {
    collections(first: 5) {
      edges {
        node {
          id
          handle
        }
      }
      pageInfo {
        hasNextPage
      }
    }
  }
}