This does not work:
{ customers(first:10, query:"hasNote:true") { pageInfo { hasNextPage } edges { node { id, firstName, ordersCount, note, hasNote } } } }
It returns records no matter what is in the 'hasNote' field.
It is listed in the GraphQL "Queryable Objects" documentation in the customer "fields" list:
https://help.shopify.com/en/api/graphql-admin-api/reference/object/customer
Yet, like a number of 'queryable objects' I've attempted to query, it does not work. Am I missing something, or is the API missing something?
Thanks
Solved! Go to the solution
This is an accepted solution.
Hi @nathanp
The queryable filter params are always in the docs. Although, hasNote is a field on Customers, it is not listed for filtering. This means you can return that, but not query based on it. Here is a direct link that should clear things up for you: https://help.shopify.com/en/api/graphql-admin-api/reference/queryroot#customers-2019-10
Vix | Developer Support @ 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
HI @vix
Why then is the document I originally referenced in 'Queryable Objects':
Take a look: https://help.shopify.com/en/api/graphql-admin-api/reference/object/customer
Right across the top of the page: "Developer resources > GraphQL Admin API > API reference > Queryable objects > Customer"
Listing fields that are, for the most part, not queryable at all in a section titled Queryable objects is not cool.
Assuming I then go looking for a second document, the one you referenced, that has the 'actual' queryable properties of the aforementioned Queryable objects is also not cool.
The Shopify GraphQL docs are unclear/inconsistent/lacking. See:
Too many people burning too much time having to second guess your API hurts...
Hey @nathanp
I understand your confusion here, the object Customers is queryable, which is why you can see this on that list. Within each object there are different fields. I find this to be a really great explanation: https://graphql.org/learn/schema/
These fields are available on the object to be returned, and you can add them into your query to see the results. However, if you are looking to query / filter, you will need to use the ones listed in the filter section. Each object and sub-object states this. For example in your link, you can see Customers has Orders, which can be then filtered based on different params:
Hope that helps
Vix | Developer Support @ 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
Yes, bad documentation is confusing.
This is good GraphQL documentation: https://developer.github.com/v4/
This is the general consensus on Shopify's GraphQL documentation: "I don't understand why the Shopify documentation is so insanely horrific."
I concede that I am, indeed, confused by mediocrity.
@nathanp did you ever find or perhaps generate any better documentation? You captured the experience well.
User | Count |
---|---|
14 | |
12 | |
10 | |
8 | |
7 |