title: graphql-dotnet how to call a query from code
body: <p>Im currently trying to call a field on graphql-query from code, without using the http layer.  In a test case I had success using this snippet inside of a field resolver. The breakpoint hits.</p>
  <pre><code>var newContext = new ResolveFieldContext(context);
  var query = context.ParentType;
  var ticketQueryField = query.GetField(&quot;getTickets&quot;);
  await (Task) ticketQueryField.Resolver.Resolve(context);
  </code></pre>
  <p>So I think its possible to fill the copied <code>ResolveFieldContext</code> with my real needed fields/arguments and call it like this. But its very ... complicated to fill the <code>ResolveFieldContext</code> by hand. So maybe there is a easier way to create the context. Like:</p>
  <pre><code>var newContext = new ResolveFieldContext(&quot;query test { getTickets(id: 1) { number, title } }&quot;);
  </code></pre>
  <p>That would be really awesome and in my real scenario there a more then just field which I want to access with the generated query.</p>
  <p>Why I want to use the Graph like this? The Batch-Loader which we are using inside the GraphQL-Types are perfect for our needs.</p>