title: How to create a list of custom objects in GraphQL
body: <p>I am currently playing around with a bunch of new technology of Facebook.</p>
  
  <p>I have a little problem with GraphQL schemas.
  I have this model of an object:</p>
  
  <pre><code>{
          id: '1',
          participants: ['A', 'B'],
          messages: [
              {
                  content: 'Hi there',
                  sender: 'A'
              },
              {
                  content: 'Hey! How are you doing?',
                  sender: 'B'
              },
              {
                  content: 'Pretty good and you?',
                  sender: 'A'
              },
          ];
      }
  </code></pre>
  
  <p>Now I want to create a GraphQL model for this. I did this:</p>
  
  <pre><code>var theadType = new GraphQLObjectType({
    name: 'Thread',
    description: 'A Thread',
    fields: () =&gt; ({
      id: {
        type: new GraphQLNonNull(GraphQLString),
        description: 'id of the thread'
      },
      participants: {
        type: new GraphQLList(GraphQLString),
        description: 'Participants of thread'
      },
      messages: {
        type: new GraphQLList(),
        description: 'Messages in thread'
      }
  
    })
  });
  </code></pre>
  
  <p>I know there are more elegant ways to structure the data in the first place. But for the sake of experimenting, I wanted to try it like this.</p>
  
  <p>Everything works fine, besides my messages array, since I do not specify the Array type. I have to specify what kind of data goes into that array. But since it is an custom object, I don't know what to pass into the GraphQLList(). </p>
  
  <p>Any idea how to resolve this besides creating an own type for messages? </p>