smooth-code / graphql-directive

Use custom directives in your GraphQL schema and queries 🎩
MIT License
152 stars 14 forks source link

it should support query variable binding #5

Closed vedmalex closed 6 years ago

vedmalex commented 6 years ago

so i have directive with variables directive @url(root: String!) on FIELD with simple resolver:

async url(resolve, source, directiveArgs) {
  return url.resolve(directiveArgs.root, await resolve())
},

so it should work with query variables binding like that query($url: String!) { foo @url(root:$url) }