Pass enum value as parameter in Apollo Client instead of a string

Viewed 155

I have the following query in a React-Native application using Apollo Client:

query getCollection($sortKey: ProductCollectionSortKeys) { ... }

Now i need to pass the value PRICE as sortKey parameter. Note: not the string "PRICE" but the enum PRICE.

If I use this syntax I will send "PRICE" instead of PRICE as enum value:

getCollection({ variables: { sortKey: "PRICE" } });

I want to send something like:

sortKey: PRICE

and not:

sortKey: "PRICE"
0 Answers
Related