# Now to pass on a variable to a graphql

**URL:** https://discourse.nodered.org/t/now-to-pass-on-a-variable-to-a-graphql/97053
**Category:** General
**Created:** [13 May 2025 13:24 UTC](https://discourse.nodered.org/t/now-to-pass-on-a-variable-to-a-graphql/97053 "2025-05-13T13:24:59Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![horemansp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/horemansp/32/97139_2.png) [@horemansp](https://discourse.nodered.org/u/horemansp)
#### Post date: [13 May 2025 13:24 UTC](https://discourse.nodered.org/t/now-to-pass-on-a-variable-to-a-graphql/97053/1 "2025-05-13T13:24:59Z")

</div>

I'm trying to pass on a variable to a GraphQL with the node-contrib-graphql. I looked at the documentation but don't understand how it works. (too much of a noob with graphQL I guess...)  
I'm trying to replace the date. I managed to format the date as required with a function, so have it as a variable available. I tried to use "{{msg.date}}" but no luck.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/0/800a8e2b53ee4daa1e6a7ac8356a0589b6276a6f.png)

This is the query:

````auto
    marketPrices(date: "2025-05-13") {
        electricityPrices {
            from
            till
            marketPrice
            marketPriceTax
            sourcingMarkupPrice
            energyTaxPrice
            perUnit
        }
        gasPrices {
            from
            till
            marketPrice
            marketPriceTax
            sourcingMarkupPrice
            energyTaxPrice
            perUnit
        }
    }
}```
````

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [11 August 2025 13:25 UTC](https://discourse.nodered.org/t/now-to-pass-on-a-variable-to-a-graphql/97053/2 "2025-08-11T13:25:58Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
