Development discussions around Shopify APIs
Hello,
I can see that inside Shop object i should be able to see all domains attached to store.
https://shopify.dev/docs/admin-api/graphql/reference/object/shop?api[version]=2020-07
object:
domains ([Domain!]!) The domains configured for the shop.
I would like get this elements but following code fail,
Could someone help me out how to fetch this values?
Bellow is my code that i'm trying to use:query {
shop {
id
name
domains(first:10)
{
node
{
url
}
}
}
}
regards
Solved! Go to the solution
This is an accepted solution.
Hey @Camil
Based on the error it looks like you are not using API version `2020-07`. The domains field was not available in previous versions.
Kevin_A | Solutions Engineer @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hey @Camil
This should work for you
{
shop{
id
name
domains{
url
}
}
}
Kevin_A | Solutions Engineer @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Thank You for reply,
I tried but got response:
"message" => "Field 'domains' doesn't exist on type 'Shop'"
Im not sure why, any others thoughts?
This is an accepted solution.
Hey @Camil
Based on the error it looks like you are not using API version `2020-07`. The domains field was not available in previous versions.
Kevin_A | Solutions Engineer @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
You'r both answers are correct:)
Thank You for Your time.
User | RANK |
---|---|
19 | |
7 | |
7 | |
6 | |
5 |
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022