title: How can I pass an array of objects into Query?
body: <p>I'm trying to figure out how to pass an array of objects into my GraphQL query, however i'm finding the documentation a little unclear on how to do so. I'm working with Apollo in the FE, Graphql-yoga in the BE and using Prisma as my database along with their API.</p>
  
  <p>Here is my query with the array of objects hard coded:</p>
  
  <pre><code>const USERS = gql`
  
    query USERS(
      $userId: ID
    ) {
      users(
        where: {
          id_not: $userId
          hasProducts_some: {
            OR: [
              { itemId: 1 },
              { itemId: 2 }
            ]
          }
        }
      ) {
        firstName
      }
    }
  `;
  </code></pre>
  
  <p>The above query returns me what I want, where i'm a bit stuck is how to get this array:</p>
  
  <pre><code>[
    { itemId: 1 },
    { itemId: 2 }
  ]
  </code></pre>
  
  <p>passed in as a variable of the query. From what I could find online, I might need to create a <code>GraphQLObjectType</code> on the client side to be able to pass in an object definition. Here was my implementation of that:</p>
  
  <pre><code>import { GraphQLObjectType, GraphQLString } from 'graphql';
  
  const ProductName = new GraphQLObjectType({
    name: 'ProductName',
    fields: () =&gt; ({
      itemId: {
        type: GraphQLString,
      },
    })
  });
  
  const USERS = gql`
  
    query USERS(
      $userId: ID,
      $hasProducts: [ProductName]
    ) {
      users(
        where: {
          id_not: $userId
          hasProducts_some: {
            OR: $hasProducts
          }
        }
      ) {
        firstName
      }
    }
  `;
  </code></pre>
  
  <p>The above returns me the following error:</p>
  
  <blockquote>
    <p>Unknown type "ProductName"</p>
  </blockquote>
  
  <p>Have I gone with the correct approach here for passing in arrays of objects, if so what's wrong with my implementation?</p>