question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Variables Object wrapped in double quotes

See original GitHub issue

According to the GraphQL spec, the variables key in the body should be sent as an Object. GraphiQL client sends this as a string which can cause unexpected behaviour on other GraphQL servers which follow the spec.

operationName:"getFilms"
query:"query getFilms($first: Int){↵  allFilms(first: $first) {↵    edges {↵      node {↵        id↵        title↵      }↵    }↵  }↵}↵"
variables:"{"first": 2}"

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
psurreycommented, Oct 20, 2016

The official graphql website states that the variables should be json object: http://graphql.org/learn/serving-over-http/#post-request

0reactions
djibariancommented, Mar 27, 2020

Quotes are only added by GraphiQL when introspecting through a GET request, not when using POST. Still present in 0.7.2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

string - wrapping a javascript variable with double quotes
Because you are using ES6 string templates, you can use double quotations ( " ) or single quotations ( ' ) within the...
Read more >
about Quoting Rules - PowerShell | Microsoft Learn
A string enclosed in double quotation marks is an expandable string. Variable names preceded by a dollar sign ( $ ) are replaced...
Read more >
Parse Template adds quotes around replaced variables
Using Mule 4.1, I have an HTML template with some variables. E.g.: ... however, the replaced values are getting wrapped in quotes. ......
Read more >
The real difference between 'single quotes' and “double ...
JavaScript Object Notation (JSON), the lightweight data storage format, only allows double quotes. If I happen to be copying back-and-forth from JavaScript ...
Read more >
Quoting and Variable Expansion in PowerShell
The consensus was to always use single quotes so that you don't unintentionally expand variables. However, I always looked at this from the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found