--- title: GraphQL queries description: Learn about GraphQL queries and follow some examples for retrieving data. source_url: html: 'https://shopify.dev/docs/apps/build/graphql/basics/queries' md: 'https://shopify.dev/docs/apps/build/graphql/basics/queries.md' --- ExpandOn this page * [How to use these examples](https://shopify.dev/docs/apps/build/graphql/basics/queries.md#how-to-use-these-examples) * [Query​Root](https://shopify.dev/docs/apps/build/graphql/basics/queries.md#queryroot) * [Fields](https://shopify.dev/docs/apps/build/graphql/basics/queries.md#fields) * [Connections](https://shopify.dev/docs/apps/build/graphql/basics/queries.md#connections) * [Filtering connections using a search query](https://shopify.dev/docs/apps/build/graphql/basics/queries.md#filtering-connections-using-a-search-query) * [Next steps](https://shopify.dev/docs/apps/build/graphql/basics/queries.md#next-steps) # GraphQL queries Note The REST Admin API is a legacy API as of October 1, 2024. All apps and integrations should be built with the [GraphQL Admin API](https://shopify.dev/docs/api/admin-graphql). For details and migration steps, visit our [migration guide](https://shopify.dev/docs/apps/build/graphql/migrate). GraphQL queries retrieve data from a server, similar to a `GET` request for a REST API. However, unlike REST, GraphQL queries are sent to a single endpoint and use the `POST` HTTP method. A GraphQL API models data as nodes that are connected by edges. A node is an object that has a global ID, such as the [`Order`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Order) or [`Product`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Product) objects. You can fetch data about an individual node, or you can follow the edges to fetch data about a collection of related nodes. At each node, you specify the fields that you want to retrieve. *** ## How to use these examples If you want to use the examples below on Shopify, you have a few options to perform queries: Shopify [provides a read-only demo store](https://shopify.dev/docs/api/usage/api-exploration/admin-graphiql-explorer#execute-queries-on-a-demo-store) which can be used to execute queries without needing to connect to a development store. You have access to the demo store via a [GraphQL Explorer interface](https://shopify.dev/docs/graphiql/admin-graphiql) where you can execute the queries on the left pane of that view. [Open the Explorer](https://shopify.dev/docs/graphiql/admin-graphiql) in a new tab or window, then paste the example query in the left pane to view the results. In the code snippets below, take a look at the `Demo store query` tabs for queries you can run. *** ## Query​Root The [`QueryRoot`](https://shopify.dev/docs/api/admin-graphql/latest/objects/queryroot) object is the initial entry point for all queries in the GraphQL API. Everything that can be queried is defined as a field or connection on the `QueryRoot` object. To learn about what data you can query, refer to the `QueryRoot` object in the relevant API's reference. Note You don't need to reference the `QueryRoot` object in your query. ### Example The following diagram illustrates example relationships between objects that are retrieved in an query: ![The relationships between the objects retrieved in the query.](https://shopify.dev/assets/assets/images/api/usage/graphql-basics/nodes-BMSxYiGC.png) The query requests the [`Shop`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Shop) object, data from a few fields, the child [`ShopAddress`](https://shopify.dev/docs/api/admin-graphql/latest/objects/ShopAddress) object, and the `products` [connection](#connections). The following is the single request structure to retrieve this data. In the response, the structure of the `data` object mirrors the query's shape: ## QueryRoot: POST https\://{shop}.myshopify.com/api/2025-10/graphql.json ```graphql query { shop { id name email billingAddress { id address1 } } products(first:2) { nodes { id title } } } ``` ```graphql query { shop { id name email billingAddress { id address1 } } products(first:2) { nodes { id title } } } ``` ```bash SHOP_TOKEN="ACCESS_TOKEN" SHOP_SUBDOMAIN="shop" curl -sX POST \ https://${SHOP_SUBDOMAIN}.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H "X-Shopify-Access-Token: ${SHOP_TOKEN}" \ -d @- <