apollographql/persistgraphql

[BUG] template strings within attributes not parsed correctly

zanettin opened this issue · 0 comments

Hi

example query:

// works via variables
query MoviesByName($name : String!) {
   movies(name: $name) { ... }
}

// works with static value
query MoviesByName() {
   movies(name: 'StarWars') { ... }
}

// does not work via template string
const name: string = 'StarWars';

query MoviesByName() {
   movies(name: ${name}) { ... }
}

all queries work on default POST request using apollo. after running persistgraphql you'll receive an error, that no value was passed to the name attribute on the 3rd example.

currently you can "workaround" it by using variables, but in some cases it would be great to just pass a variable via template string literals.

package version
apollo client 2.2.2
persistgraphql 0.3.11

thanks for the great tool 👍