Variables

You can pass variables recieved from the client to the execution engine by using the Inputs property.

See the official GraphQL documentation on variables

Here is what a query looks like with a variable:

query DroidQuery($droidId: String!) {
  droid(id: $droidId) {
    id
    name
  }
}

Here is what this query would look like as a JSON request:

{
 "query": "query DroidQuery($droidId: String!) { droid(id: $droidId) { id name } }",
 "variables": {
   "droidId": "1"
 }
}

Call .ToInputs() to translate JSON variables into a format that the library can work with.

var variablesJson = // get from request
// `ToInputs` extension method converts the json to the `Inputs` class
var inputs = variablesJson.ToInputs();

schema.Execute(_ =>
{
  _.Query = "...";
  _.Inputs = inputs;
});