How do I add a variable to my GraphQL query?

  • Goal: Add a variable to a GraphQL query

  • Steps: 1. Add a new query 2. Select my GraphQL API as the source 3. Write query (see example) and wrap it with a required string variable 4. Add a value for the string variable under General > Variables 5. Run the query 6. Error that string variable is required and not provided even though I did provide it

  • Details: The query I am trying to execute:

query Repositories($tenantId: String!) {
  repositories(data: {
    tenantId: $tenantId
  }) {
    name
    projectName
    hostname
    pathname
    owner
  }
}
  • Screenshots:

Hm, after clicking around and coming back to the query it randomly decided to start working

1 Like

Also saw some wonkiness in the GraphQL variable editor, specifically looks like the value didn't actually save and I had to reload the app where it similarly started working :thinking: Let's keep an eye out for now in case it happens again or better if we can reproduce it to debug!