--- title: domain - GraphQL Admin description: Returns a `Domain` resource by ID. api_version: 2025-10 api_name: admin type: query api_type: graphql source_url: html: https://shopify.dev/docs/api/admin-graphql/latest/queries/domain md: https://shopify.dev/docs/api/admin-graphql/latest/queries/domain.md --- # domain query Returns a `Domain` resource by ID. ## Arguments * id [ID!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID) required The ID of the `Domain` to return. *** ## Possible returns * Domain [Domain](https://shopify.dev/docs/api/admin-graphql/latest/objects/Domain) A unique string that represents the address of a Shopify store on the Internet. *** ## Examples * ### Retrieve a domain by ID #### Description Retrieve information about a domain by its ID. #### Query ```graphql query { domain(id: "gid://shopify/Domain/948873163") { host url } } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query { domain(id: \"gid://shopify/Domain/948873163\") { host url } }" }' ``` #### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query { domain(id: "gid://shopify/Domain/948873163") { host url } }`, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY query { domain(id: "gid://shopify/Domain/948873163") { host url } } QUERY response = client.query(query: query) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: `query { domain(id: "gid://shopify/Domain/948873163") { host url } }`, }); ``` #### Response ```json { "domain": { "host": "www.snowdevil.ca", "url": "https://www.snowdevil.ca" } } ``` * ### Retrieve information about a shop's domains #### Description The following query retrieves information for the domain names associated with the shop. #### Query ```graphql query { shop { domains { id host url } } } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query { shop { domains { id host url } } }" }' ``` #### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query { shop { domains { id host url } } }`, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY query { shop { domains { id host url } } } QUERY response = client.query(query: query) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: `query { shop { domains { id host url } } }`, }); ``` #### Response ```json { "shop": { "domains": [ { "id": "gid://shopify/Domain/26371970", "host": "snowdevil.myshopify.com", "url": "https://snowdevil.myshopify.com" }, { "id": "gid://shopify/Domain/948873163", "host": "www.snowdevil.ca", "url": "https://www.snowdevil.ca" } ] } } ``` [Open in GraphiQL](http://localhost:3457/graphiql?query=query%20%7B%0A%20%20domain\(id%3A%20%22gid%3A%2F%2Fshopify%2FDomain%2F948873163%22\)%20%7B%0A%20%20%20%20host%0A%20%20%20%20url%0A%20%20%7D%0A%7D) ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query { domain(id: "gid://shopify/Domain/948873163") { host url } }`, ); const json = await response.json(); return json.data; } ``` ##### GQL ``` query { domain(id: "gid://shopify/Domain/948873163") { host url } } ``` ##### cURL ``` curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query { domain(id: \"gid://shopify/Domain/948873163\") { host url } }" }' ``` ##### React Router ``` import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query { domain(id: "gid://shopify/Domain/948873163") { host url } }`, ); const json = await response.json(); return json.data; } ``` ##### Node.js ``` const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: `query { domain(id: "gid://shopify/Domain/948873163") { host url } }`, }); ``` ##### Ruby ``` session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY query { domain(id: "gid://shopify/Domain/948873163") { host url } } QUERY response = client.query(query: query) ``` ## Response JSON ```json { "domain": { "host": "www.snowdevil.ca", "url": "https://www.snowdevil.ca" } } ```