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 |
---|---|
51 | |
11 | |
8 | |
6 | |
6 |
Thanks to all who participated in our AMA with 2H Media on planning your 2023 marketing bu...
By Jacqui Mar 30, 2023Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...
By Jacqui Mar 10, 2023Upskill and stand out with the new Shopify Foundations Certification program
By SarahF_Shopify Mar 6, 2023