title: GraphQL.NET: How to separate the root query into multiple parts
body: <p>I currently have a small application which is using GraphQL to communicate with the .net core backend. I currently have one one root query as is mandatory for GraphQL and am looking for a way to break this up into multiple pieces for organization's sake. My Query looks as follows:</p>
  
  <pre><code>public class ReactToFactsQuery : ObjectGraphType
  {
      public ReactToFactsQuery(IArticleService articleService,
          INewsItemService newsItemService)
      {
          Field&lt;ArticleType&gt;(
              name: "article",
              arguments: new QueryArguments(new QueryArgument&lt;IntGraphType&gt; { Name = "id" }),
              resolve: context =&gt;
              {
                  var id = context.GetArgument&lt;int&gt;("id");
                  return articleService.Get(id);
              }
          );
  
          Field&lt;ListGraphType&lt;ArticleType&gt;&gt;(
              name: "articles",
              arguments: new QueryArguments(new QueryArgument&lt;IntGraphType&gt;() { Name = "count" }),
              resolve: context =&gt;
              {
                  var count = context.GetArgument&lt;int?&gt;("count");
                  if (count.HasValue)
                  {
                      return articleService.GetAll(count.Value);
                  }
                  else
                  {
                      return articleService.GetAll();
                  }
  
              }
          );
  
          Field&lt;ListGraphType&lt;NewsItemType&gt;&gt;(
              name: "newsItems",
              arguments: new QueryArguments(
                  new QueryArgument&lt;IntGraphType&gt;() { Name = "count" },
                  new QueryArgument&lt;IntGraphType&gt;() { Name = "newsType" }),
              resolve: context =&gt;
              {
                  var count = context.GetArgument&lt;int?&gt;("count");
                  var category = context.GetArgument&lt;int&gt;("newsType");
                  var newsType = (NewsType)category;
  
                  if (count.HasValue)
                  {
                      return newsItemService.GetMostRecent(newsType, count.Value);
                  }
                  else
                  {
                      return newsItemService.GetMostRecent(newsType);
                  }
              }
          );
      }
  }
  </code></pre>
  
  <p>Currently the query is pretty small and manageable but as the application grows, I can easily see there being a huge number of queries defined in this class. THe current query names that exist are <code>article</code>, <code>articles</code>, and <code>newsItems</code>. Preferably, I'd like to create a query class to represent each model type (i.e one query class for article related queries, one for news item related queries, etc).</p>
  
  <p>I've read the documentation <a href="https://graphql-dotnet.github.io/docs/getting-started/query-organization" rel="noreferrer">here</a> however I for whatever reason am struggling to understand the example here and how to apply it to my code. </p>
  
  <p>All help is appreciated.</p>