How to search customers by name in GraphQL API ?

nakamegu
New Member
2 0 0

To search customer with "firstName: Bob", isn't this query correct?

There are many customers whose firstName is not Bob in results.

https://shopify.dev/docs/admin-api/graphql/reference/customers/customer#samples

 

{
  customers(first:10, query:"firstName:Bob") {
    edges {
      node {
        firstName
      }
    }
  }
}

 

 

0 Likes
Jayvin
Shopify Partner
217 34 56

Hi,

# Get the first 10 customers with name Bob
{
  customers(first: 10, query:"bob") {
    edges {
      node {
        id
        email
        firstName
      }
    }
  }
}

 

0 Likes
nakamegu
New Member
2 0 0

Thanks Jayvin,

In your example, the "bob" is not only in "firstName" right?

I think the results have "bob" in one of fields in the object.

0 Likes