Out now! Check out the Poll results: Do you have a Shopify store?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Customer 'sms_marketing_consent' field from REST API is missing in GraphQL

Customer 'sms_marketing_consent' field from REST API is missing in GraphQL

locomojo
Shopify Partner
8 0 2

This is question directed towards Shopify staff. I'm running into issues with some of the REST fields missing in GraphQL. 

 

The REST API for "Customers" has a "sms_marketing_consent" field, but it's missing in the GraphQL version. 

 

REST version ('sms_marketing_consent' is here): 

https://shopify.dev/api/admin-rest/2023-01/resources/customer 

 

'sms_marketing_consent' is missing in GraphQL:

https://shopify.dev/api/admin-graphql/2023-01/queries/customer

 

GraphQL only has 'acceptsMarketing' field is in GraphQL but it's not SMS marketing so doesn't help.GraphQL only has 'acceptsMarketing' field is in GraphQL but it's not SMS marketing so doesn't help.

 

Is there any chance we could get this added to GraphQL API? I'm simply trying to get a list of all customers that accept SMS marketing, and want to do it with GraphQL so I can do pagination and maybe even bulk queries since a lot of stores have more than 250 customers. I'm working with lists larger than 250 and don't want to build my own throttle using the REST API if I don't have to with GraphQL. Help?

 

REST version has 'sms_marketing_consent' which is missing in GraphQLREST version has 'sms_marketing_consent' which is missing in GraphQL 

 

 

 

Reply 1 (1)

ShopifyDevSup
Shopify Staff
1453 238 522

Hi @locomojo 👋

 

In GraphQL, we can use the `Customer.smsMarketingConsent` field.

 

Hope that helps!

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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