Flow query question

Trying to get a list of variants with empty sku.

This query works in GraphiQL:

query MyQuery {
  productVariants(first: 10, query: "sku:\"\"") {  

Running the same in Flow produces no results:

This works in GraphiQL too – query: "-sku:\"*\"", but in Flow it returns a list of variants with non-empty SKUs:

Something with escaping?
@paul_n

Because of the escaping, I can’t tell what’s in your configuration. Can you show what you have in the action?

It’s possible that your query isn’t actually working in GraphiQL and instead your are just getting a different set of results by sorting differently.

Sorry, hope this is more readable.
Sort is the same in all tests, FULL_TITLE
Trying to get a list of productVariants with empty SKU – how do I do that?


GraphiQL query:

"sku:\"\""

Properly lists productVariants with empty SKU


Flow query (as typed in)

sku:""


is shown in Log like this:

and returns Empty array.


Flow query (as entered)

NOT sku:*

returns Empty array


Flow query (as entered)

NOT sku:"*"

or

-sku:"*"

both return array of variants with non-empty SKUs (wrong)

In Flow, I tested sku:”” this morning and got a list of products that don’t have a SKU.

Are you sure you are using “Get product variant data” as the action? Maybe trying a different sort key, in case it doesn’t work with the SKU query for some reason. I sorted by “SKU” when it worked

Update - the sort key is definitely the issue

Confirm.

So, if someone wants to find variants with empty SKU, the solution is:

  • use “get product variants data” action
  • use query sku:""
  • set sort order to “SKU” – important.

Thanks @paul_n – I’d never think about trying different sort order. Isn’t it a bug?

Yeah, I reported it to the team that owns that API.