Anchor to domain
domain
query
Lookup a Domain by ID.
Anchor to Possible returnsPossible returns
- Anchor to DomainDomain•
A unique string that represents the address of a Shopify store on the Internet.
- host•String!non-null
The host name of the domain. For example,
example.com
.- id•ID!non-null
A globally-unique ID.
- localization•Domain
Localization The localization of the domain, if the domain doesn't redirect.
- market
Web •Presence MarketWeb Presence The web presence of the domain.
- ssl
Enabled •Boolean!non-null Whether SSL is enabled.
- url•URL!non-null
The URL of the domain (for example,
https://example.com
).
- host•
Was this section helpful?
- Retrieve a domain by ID
- Retrieve information about a shop's domains
Examples
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
domain(id: "gid://shopify/Domain/948873163") {
host
url
}
}`,
);
const data = await response.json();
query {
domain(id: "gid://shopify/Domain/948873163") {
host
url
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2024-07/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 } }"
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
domain(id: "gid://shopify/Domain/948873163") {
host
url
}
}`,
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: `query {
domain(id: "gid://shopify/Domain/948873163") {
host
url
}
}`,
});
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{
"domain": {
"host": "www.snowdevil.ca",
"url": "https://www.snowdevil.ca"
}
}