GraphQL Variable
Beta only
Note: This feature is currently in Beta.
GraphQL Variables Block
The Variables block in Voiden is used to pass dynamic values into your GraphQL queries, mutations, or subscriptions. Instead of hardcoding values directly inside the Query block, you define them here and let Voiden inject them at runtime.
This separation keeps your GraphQL requests clean, readable, and easy to reuse across different scenarios.
Key points about the Variables block:
- Used to send dynamic input values such as IDs, filters, or user input
- Keeps queries flexible without changing their structure
- Makes testing different cases simple by updating only the variables
- Helps avoid duplication and hardcoded values
- Works seamlessly with the Query block
In simple terms, the Variables block provides the “inputs” for your GraphQL request, while the Query block defines the “logic.” Together, they make working with GraphQL in Voiden clear, organized, and efficient.
Try It Out
- In your Voiden file, type
/gqlvariablesand press Enter to create a GraphQL variables.

-
Once the query includes variables, Voiden automatically creates a Variables block. This block appears as a JSON code editor where you can define the values for those variables.
Provide Variable Values
- Enter values manually as JSON
- Use environment variables
- Use runtime variables
This gives you flexibility to test different inputs without modifying the query itself.
-
Run the request using Cmd + Enter (Mac) or Ctrl + Enter (Windows/Linux), or click the green Play button in the toolbar.

Summary
The GraphQL Variables block in Voiden lets you pass dynamic values to your queries without hardcoding them. By separating inputs from query logic, it keeps requests clean, reusable, and easy to test across different scenarios.