GraphQL Filters - Serious - Results NOT returning expected

The filter parameter on various GraphQL queries are either not working OR lacking documentation.

For example the companyLocations query when filtering by company_id returns a completely incorrect result.

Other queries require single quotes around string fields otherwise, they too yield incorrect results (the documentation does not mention this).

This is leading to data corruption and akin to writing a SQL query with a join but the joined data being comptelely incorrect.

Many Thanks

Hi @James_Hutchison - thanks for reaching out.

I’d like to dig into the specific behavior you’re seeing. Could you share two things to help us trace it:

  1. The exact query you’re running including the query: filter string as you’re passing it (e.g. the full companyLocations(query: "...") argument). Seeing the literal syntax will help us confirm whether it’s a parsing issue or unexpected results.

  2. An X-Request-ID from one of the affected responses. Every Admin API response includes this header, and it lets us pull the exact request server-side to see what was matched and returned.

A couple of notes that may help in the meantime:

  • The query: argument uses Shopify API search syntax (Shopify API search syntax), which behaves differently from a SQL-style WHERE clause. Notably, “to send composite terms to a field, wrap them in quotes or give them each a field prefix”. This means composite or multi-word values often do need single quotes (e.g. query: "company_id:'12345'") which could explain the quoting behavior you hit.

Once I have the query and a request ID I can take a closer look.