Development discussions around Shopify APIs
I am looking for the easiest way to get the default physical location for inventory. I can query for Locations, and receive back one or more locations. So if there is one, I assume it is the default. But if I receive 2 or more, can I assume the first is the default? Can that be confirmed, or is there some other way to confirm the default location?
Solved! Go to the solution
This is an accepted solution.
If you query location with no id the docs say: "If no ID is provided, the primary location of the Shop is returned."
I'm not sure if that is what you mean by default physical location for inventory but it might help.
This is an accepted solution.
If you query location with no id the docs say: "If no ID is provided, the primary location of the Shop is returned."
I'm not sure if that is what you mean by default physical location for inventory but it might help.
You mean like this right?
query {
location {
id
name
address {
phone
formatted
}
fulfillmentService {
id
handle
}
}
}
And that did return a single location. So I guess I will take that as that. Thanks. Note that the schema itself makes no mention of this, so I am indebted to your eagle eyes for picking that aspect out of the pile and showing it to me.
Yeah, I am still really struggling to both decipher and navigate the docs. I found it in the query root docs under fields and then location, which I can't direct link, But this is the link to fields:
What do you mean by schema? The schema you query with GraphQL itself?
Yes. Using Insomnia one can quickly review any aspect of the queries by a link direct to the schema in use. It beats clicking through the clunky docs, which are machine-generated anyway, and rarely offer any human insight into how things are used or why.
User | RANK |
---|---|
10 | |
4 | |
3 | |
3 | |
3 |
We're excited to announce improvements to the threaded messaging experience in our communi...
By TyW May 31, 2023Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...
By Ollie May 25, 2023