Support for query variables
See original GitHub issueIt looks like express-graphql and graphql-ruby accept queries with query and variables in separate structures. For example, here is a query generated by the express-graphql client library.
{
"query":"query AppHomeRoute($uuid_0:String!) {
account(uuid:$uuid_0) {
...
}
}",
"variables":{"uuid_0":"88888888-4444-4444-4444-121212121212"}
}
Here are a couple articles discussing variables:
- http://rmosolgo.github.io/blog/2016/03/03/using-graphql-without-relay/
- https://medium.com/the-graphqlhub/graphql-tour-variables-58c6abd10f56#.3lumjqvbm
It doesn’t look like the graphql-java server accepts query variables like this currently. It seems like this would be a nice feature to have, so you can use graphql-java servers with the relay-starter-kit.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Add support for variables in plugins | Grafana documentation
Query variables is a type of variable that allows you to query a data source for the values. By adding support for query...
Read more >Query Variables - Arctype
Query variables allow values to be attached to variables so that a single value ... Query variables support String, Number, Date, and Boolean...
Read more >How to use GraphQL variables to give queries type safety
Click on the query variables pane at the bottom of the GraphiQL explorer. Create an object, and add your stringified variable name and...
Read more >Use parameters to ask for input when running a query
Parameter A parameter is a piece of information you supply to a query right as you run it. Parameters can be used by...
Read more >Query Variables - PopSQL
Reusable and flexible queries, powered by query variables. Pass parameters into queries with a simple UI. Make your SQL versatile with if/else statements....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@SebastianWjertzoch as mentioned above: you have to declare the variable.
you query is
but it is missing the declaration of the variable. It should like this:
I hope this helps
well … if you wanna use a variable you have to declare the variable.
the query you mention works fine, because you don’t use a variable, hence you don’t have to declare it.