Answers.Body: <p>For anything else than base element fields, you'll need to use an <a href="https://graphql.org/learn/queries/#inline-fragments" rel="nofollow noreferrer">inline fragment</a> to fetch your custom fields like so:</p>
  
  <pre><code>query test {
    entries(section: "vacancies", limit: 20) {
      title
      expiryDate
      ...on sectionHandle_entryTypeHandle_Entry {
        description
      }
    }
  }
  </code></pre>
  
  <p>Replace <code>sectionHandle</code> and <code>entryTypeHandle</code> with your values, I guess something like <code>vacancies_vacancies_Entry</code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-26T12:30:46.570Z
Answers.LastActivityDate: 2020-02-26T12:30:46.570Z
Answers.UserDisplayName: Oli
Body: <p>This is definitely a noob question, but I can't seem to find an answer to this. (Completely new to GraphQL).</p>
  
  <p>I'm trying to simply return entries:</p>
  
  <pre><code>query test {
    entries(section: "vacancies", limit: 20) {
      title
      expiryDate
      description
    }
  }
  </code></pre>
  
  <p>Since the description is a custom field, this gives an error. How do I get a custom field value?</p>
  
Tags: <craft3><graphql>
Title: How to return custom fields in GraphQL
ThreadText: # How to return custom fields in GraphQL
  
  (Asked by: username_0 on 2020-02-26)
  
  This is definitely a noob question, but I can't seem to find an answer to this. (Completely new to GraphQL).
  
  I'm trying to simply return entries:
  
  ```
  query test {
    entries(section: "vacancies", limit: 20) {
      title
      expiryDate
      description
    }
  }
  
  ```
  
  Since the description is a custom field, this gives an error. How do I get a custom field value?
  
  **Tags:** craft3, graphql
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-02-26. Score: 3 | Accepted answer
  
  For anything else than base element fields, you'll need to use an [inline fragment](https://graphql.org/learn/queries/#inline-fragments) to fetch your custom fields like so:
  
  ```
  query test {
    entries(section: "vacancies", limit: 20) {
      title
      expiryDate
      ...on sectionHandle_entryTypeHandle_Entry {
        description
      }
    }
  }
  
  ```
  
  Replace `sectionHandle` and `entryTypeHandle` with your values, I guess something like `vacancies_vacancies_Entry`
  
  
  ---
  
  