Missing dynamic GraphQL context with CMS React

Hi! Is there anyway we can pass dynamic context to the graphql query when used with CMS React?
Using this simlpe query doesn’t work:

export const query =`
# $product_uid: "foo"
query MyQuery($product_uid: String!) {
 HUBDB {
 my_product_collection(limit: 3, filter: {product_uid__contains: $product_uid}) {
 items {
 product_name
 }
 }
 }
}
`

Hey, @royyanbach :waving_hand: Thanks for the question. I’d like to invite some of our community members to the conversation — @Teun @Kevin-C @ChrisoKlepke do you have any recent experience here?

Best,

Jaycee

@royyanbach I believe your approach should work when deployed, as we’ve successfully used that approach numerous times. It just doesn’t work when running the project locally for some reason. :confused:

@royyanbach if you need the query to work locally, you can set a default value for $product_uid like so:

export const query =`
# $product_uid: "foo"
query MyQuery($product_uid: String! = "foo") {
 HUBDB {
 my_product_collection(limit: 3, filter: {product_uid__contains: $product_uid}) {
 items {
 product_name
 }
 }
 }
}