title: apollo graphql pass arguments to resolve function
body: <p>I have a schema with associated categories and markers</p>
  
  <pre><code>type Category {
      id: Int
      name: String
      parent: Category
      children: [Category]
      markers: [Marker]
  }
  
  type Marker {
      id: Int
      name: String
      categories: [Category]
  }
  
  type Query {
    category(limit: Int, offset: Int): [Category]
    marker(limit: Int, offset: Int): [Marker]
  }
  
  schema {
    query: Query
  }
  </code></pre>
  
  <p>I can now write a query like this: </p>
  
  <pre><code>query{
    category(limit: 3){
      name
      markers{
        name
  
      }
    }
  }
  </code></pre>
  
  <p>How can I define possible arguments for the markers as well? --></p>
  
  <pre><code>  query{
        category(limit: 3){
          name
          markers(limit: 3){
            name
  
          }
        }
      }
  </code></pre>
  
  <p>so I can use the argument in the resolvers --></p>
  
  <pre><code>        export const resolvers = {
              Query: {
                  async category(root, args, context) {
                      return Categories.findAll({limit: args.limit, offset: args.offset});
                  },
                  async marker(root, args, context) {
                      return Markers.findAll({limit: args.limit, offset: args.offset});
                  },
              },
              Category: {
                  async markers(category){
                      return category.getMarkers();
                  }
              }
      }
  </code></pre>
  
  <p>I.e. I can pass it into the query resolvers since it is defined in the schema, but I cannot apply it to the markers resolver within the category type</p>