Hey @HunkyBill,
Locations from custom fulfillment services will only show up in the GraphQL response if you include includeLegacy:true on the connection.
You can see that in the docs here.
... View more

Ah ok, I think I get the main question now.
You're wondering if there's a way to select which version of CarrierService rate requests Shopify will make to your app, similar to how you can do so with Webhooks, correct?
There is currently no way to specify a version for the rate requests that Shopify will make to a CarrierService.
That being said, it's a bit of an odd question, because there aren't different types of rate requests.
Shopify makes the same type of request to every CarrierService, regardless of if it is of type api or legacy.
Can you post more details about the differences between request_1 and request_2?
What is the scenario that prompted you to build a new handler?
... View more

Hey AlexeyA!
The carrier_service_type is api if it was created by an app.
legacy carrier services are those that available directly through Shopify, such as Canada Post.
Is there a reason you were looking to change this value?
... View more

Hey there!
from a similar thread: https://community.shopify.com/c/Shopify-APIs-SDKs/Set-sales-channel-for-productCreate/m-p/540860#M35722
We do have the Publication object , but the required scope (read_publications/write_publications) is currently a protected scope that we are still building out a process for applying for. I'd recommend staying subscribed to our Developer Changelog for any updates to the availability of this object.
... View more

Hey ClementBR!
I have not heard of any plans to add cost to an order's line item.
However, you could definitely perform this mapping as an app by verifying costs in response to an order webhook.
Additionally, for orders that existed before your app was installed, you could compare the updated_at fields on both the order and the inventory_item to determine if the cost has potentially changed since the order was placed.
... View more

Hey Min!
Thanks for taking the time to layout your setup very clearly.
> why is only a single request made?
I just tested this on my end and am not seeing the same result. I received 1 request per profile+location in my cart as expected.
Can you double check that your products are associated to different profiles? Feel free to DM me your test shop / app details.
> why does the request contain all the items in the cart rather than just the delivery profile ones
This is a bug, and calls to your carrier service app should only contain the items relevant to that profile+location, as you'd expect.
We will look into this, good catch!
> making a single carrier service call and doubling the rate will lead to incorrect results. We definitely don't want to be doing that. As far as I can tell, we aren't actually doing this behavior. The correct result in your scenario should have resulted from making multiple calls to your carrier service app, getting $10 back each time, then consolidating those rates. Are you able to quickly modify your responses (say, based on origin) and return different rates to confirm what is happening? (doubling versus consolidation)
... View more

Hey LiorH!
SKUs aren't unique within Shopify, so I would hesitate in using it as a key. They can also be modified, so it would be possible to accidentally "lose" your reference to the resource if the SKU changes for some reason.
Each resource has a unique ID (which you are selecting in your graphql query). Is there a reason you can't use the ID field in conjunction with the "product" query available on QueryRoot? Typically, apps will cache these IDs as the reference to these resources.
On top of being safer, there's a complexity-cost efficiency gain as well.
Using the `products` connection for searching costs `3`, which might not seem like a ton.
However, querying directly for the `product(id:"gid")` costs `1`, which is a third of the cost (and therefore makes your app 300% faster in this scenario in regards to throttling).
If you're still set on accessing `customers` this way, the email field can not be re-used (aka is unique) within a shop.
... View more

Hey Andri_Franklin!
It sounds like you're looking to create inventory levels for existing products with a productUpdate mutation.
Are you using the inventoryQuantities field? This is a create-only field, so to accomplish your goal of updating an existing product, you'll have to use the inventoryActivate mutation.
In this mutation, you provide the location ID, the inventoryItem ID, and the available quantity (your stock level).
Here's an example:
mutation {
inventoryActivate(
locationId: "gid://shopify/Location/13968867384",
inventoryItemId: "gid://shopify/InventoryItem/12250271711288",
available: 5
)
{
inventoryLevel {
id
available
}
}
}
... View more

Hey @bradgarropy You can also access all the policies directly through the REST Admin API's policies.json endpoint. Your app can use the same token/authorization to access both the GraphQL and REST admin APIs, so this is probably easier than trying to also get a storefront access token.
... View more

Hey @bradgarropy ! The Shop object in the GraphQL Admin API doesn't have these fields. However, the Shop object in the GraphQL Storefront API has all of these, minus shippingPolicy. If you're using the Shopify GraphiQL App from our GraphQL Admin API Explorer docs, it will only have access to the admin side of things. To see the GraphQL Storefront API in action, you can check out the in-browser demo we have in the GraphQL Storefront API Explorer docs. These are two different APIs, both accessible with GraphQL. It can be a little unclear which API a particular doc is referring to, especially since we use the same "GraphQL explorer" terminology for both.
... View more

Hey HoosierDaddy!
The parameters you can include during requests, as well as the different options and their defaults, are listed on that doc page.
You can usually find them at the top of of each endpoint's section.
Ex: https://help.shopify.com/en/api/reference/orders/order#index
... View more

Hey!
If you have the variant ID as well, you don't really need to go through the product.
You should be able to just go directly through the productVariant query.
It should look like this:
productVariant(id: $id) {
id
title
inventoryItem {
id
}
}
https://help.shopify.com/en/api/graphql-admin-api/reference/queryroot#productvariant
... View more

Thanks for the extra info David, it cleared things up!
I'm able to reproduce a similar behavior. Specifically, if the tag string you've provided has a comma during the GraphQL mutation, and you attempt to filter a collection by a tag, you'll get no results.
Looking at the documentation, it seems the mutation is expecting an array of tags, instead of a comma seperated string.
I tested submitting multiple tags as an array, and this works as desired.
... View more

Hey David!
I just ran a quick productUpdate in my test store and it seems to be getting picked up by the automatic collections.
Your product seems to be in multiple auto-collections as well. I took a quick look and couldn't find a collection for just "2018".
Can you be more specific about which tags are not getting picked up by which auto-collections?
... View more

Hey G!
Glad to see you worked it out, and props for coming back to the thread and writing up your solution.
I wanted to drop by the thread quickly to show how this is highlighted in the docs.
In the API reference for the productCreate mutation, you can see that the ImageInput! parameter has square brackets around it, [], which shows that this parameter is expecting an array of ImageInputs.
... View more

Hey heriG!
Being able to get the first "n" is intended, as it enables you to get subsets of connections. You can combine it with pagination (cursors and the pageInfo / hasNextPage fields) to ensure you are getting all the lineItems.
You can find more details on pagination as well as a more complete example in the documentation.
... View more

Hey Nemo,
If you're ever unsure of what the proper input for a field is, a good strategy is to query an existing object (ex: A customer you've already created in the admin with a phone number) and see how the data is returned.
"customer": {
"id": "gid:\/\/shopify\/Customer\/625705451542",
"email": "alextest4@space.ca",
"phone": "+14168884446"
}
Not sure on your second post, I just ran a checkoutCustomerAssociate mutation on my test store and it goes through fine.
I messed around with the checkoutID and was able to reproduce your issue, but had to pass an invalid checkout ID. Can you double-check your checkout ID?
... View more

Hi Nemo!
In order to get an error message back from a failed mutation, you'll need to select on the userErrors field, like in the createCustomer example. GraphQL will only return what you ask for, and so it's good practice when making mutation calls to include this field to help with your troubleshooting.
Try adding this field and running your query again to see what errors are occurring.
... View more

Hey Steve,
I'm assuming by "anybody" you meant other partners, but I just wanted to dip into the thread and mention that we've been using this internally at Shopify for years in production. :)
I'm also curious to hear more about what kind of docs you're looking for from us. We're keen on making the transition from REST to GQL smoother for our partners, so any leads on the type of resources that would make that experience cleaner are great!
Finally, what kind of calls are you making where the GQL limits seem low? I think for gathering large amounts of data (ex: get all products) the REST API has some advantages, but for more specific things (ex: adjusting the inventory quantity) GQL has the lead.
... View more

Hey James,
The forum post you linked shows the Customers Count endpoint.
Customer count:
https://www.shopify.com/admin/customers/count.json
Is this not what you are looking for?
Your app could query this endpoint daily, store it locally, and return the value when requested.
... View more

Hey Patrick,
What are you using to submit these calls? I see on our end that the array of variants isn't getting to us in the expected format.
For reference, my test request:
"variants"=>[{"option1"=>"First", "price"=>"10.00", "sku"=>"123"}, {"option1"=>"Second", "price"=>"20.00", "sku"=>"123"}]
your request:
"variants"=>{"0"=>{"option1"=>"First", "price"=>"10.00", "sku"=>"123"}, "1"=>{"option1"=>"Second", "price"=>"20.00", "sku"=>"123"}}}
... View more

Hey Patrick,
I just tested this endpoint with variant, images and metafields in my dev store and it seems to be working for me.
meta fields example triggers an error expecting an array instead of a hash.
The meta field input is an array of hashes.
"metafields": [
{
"key": "new",
"value": "newvalue",
"value_type": "string",
"namespace": "global"
}
]
What's your actual request look like?
... View more