I use GraphQLHttpClient in graphql-dotnet library to send query request. So How I can query with variables?
Like tthis:
{
“query”: “query ($sku: String) { product (sku: $sku) { id, legacy_id, account_id, name, sku, price, value, barcode, country_of_manufacture } }”,
“variables”: {
“sku”: “CC0001”
}
}
Hey @dattv,
Thanks for reaching out and welcome to our Developer Community!
If you were attempting to query a product using a variable you could try something like this:
query SKUVar($sku: String) {
product(sku: $sku) {
request_id
complexity
data {
id
legacy_id
account_id
}
}
}
Variables:
{
"sku":"yourSKUhere"
}
Let me know if that helps!
Best,
RayanP