title: Correct way to filter an array in graphql
body: <p>I have the following arrangement:</p>
  
  <pre><code>const Person = function(name, age, interest) {
      this.name = name;
      this.age = age;
      this.interest = interest;
  }
  
  const people = [
      new Person("rajat", 29, ['prog','food','gym']),
      new Person("ravi", 23, ['travel', 'cook', 'eat']),
      new Person("preeti", 19,  ['comedy', 'arts', 'beauty'])
  ];
  
  const schema = buildSchema(`
      type Person {
          name: String,
          age: Int,
          interest: [String]
      },
      type Query {
          hello: String,
          giveTen(input: Int!): Int,
          person(name: String!): Person!, 
      }
  `);
  
  const root = {
      hello: () =&gt; 'Hello World',
      giveTen: (args) =&gt; args.input * 10,
      person: (args) =&gt; people.filter(item =&gt; item.name === args.name),
  };
  </code></pre>
  
  <p>When I run the following query:</p>
  
  <pre><code>query PersonDetails {
    person(name: "rajat") {
      name
      age
      interest
    }
  }
  </code></pre>
  
  <p>I get bunch of <code>nulls</code>, when there clearly is matching data in <code>people</code> array.</p>
  
  <pre><code>{
    "data": {
      "person": {
        "name": null,
        "age": null,
        "interest": null
      }
    }
  }
  </code></pre>