Graphql query for customers with date filter not filtering

Solved
Highlighted
New Member
3 0 0

Dear Shopify / community,

I am building an app that allows users to analyze their store performance. For this we let the app query the Graphql API and I seem to have run into a potential bug as it only seems to happen on the customers' object.

I would like to only return customers that were created in 2019 using the below request. However, the response returns all of my customers. When I perform a similar request for orders or products then the filtering does work as expected.


Request to /admin/api/2019-10/graphql.json

Content of query
{ customers(first: 250, query:"created_at:>2019-01-01") { edges { cursor node { acceptsMarketing acceptsMarketingUpdatedAt averageOrderAmount canDelete createdAt displayName email firstName hasNote hasTimelineComment id lastName legacyResourceId lifetimeDuration marketingOptInLevel note ordersCount phone state tags taxExempt totalSpent updatedAt validEmailAddress verifiedEmail } } pageInfo { hasNextPage } }}

Am I doing something wrong or is this a bug?

0 Likes

Success.

Shopify Staff
Shopify Staff
223 28 28

Hi @mverstrepen 

 

created_at is not currently a queryable field for Customers. Here is the list: https://help.shopify.com/en/api/graphql-admin-api/reference/queryroot#customers-2019-10you should be able to use customer_date, which is an alias to created_at in this case. 

 

 

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


1 Like
New Member
3 0 0

Thank you, this solved my problem.

0 Likes