title: How can I get the field value from GraphQL query?
body: <p>I have the Apollo Client that query the value from MongoDB collection then I try to fetch the value from "findOne". When I try to get the value (for example "eventname", it alert that "cannot read property 'eventname' of undefined".</p>
  
  <p>This is the schema and resolver.</p>
  
  <pre><code>type Event {
      _id: ID!
      eventname: String!
      remark: String
      username: String
      createdAt: Date 
      updatedAt: Date
      registers: [Register]
  }
  
  type Query {
      eventList(_id: ID): Event
  }
      eventList: async(parents, args, { Event }) =&gt; {
          const eventList = Event.findOne({ _id: args._id });
  
          if (!eventList) {
              throw new Error('No such event found');
          }
  
          return eventList;
      },
  </code></pre>
  
  <p>The query from client:</p>
  
  <pre><code>class RegistersIndex extends Component {
  
      render() { 
          const { data: {loading, error, eventList}, match } = this.props;
          console.log(eventList.eventname);
  ...
  ...
  export const eventsListQuery = gql`
      query EventsListQuery ($eventid: ID!) {
      eventList (_id: $eventid) {
          _id
              eventname
              remark
              username
              createdAt
              updatedAt
      }
    }
  `;
  
  export default graphql(eventsListQuery, {
      options: (props) =&gt; ({
          variables: { eventid: props.match.params._eventid },
      })
  })(RegistersIndex);
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/JA4XZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JA4XZ.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/9Tk87.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9Tk87.png" alt="enter image description here"></a></p>