Answers.Body: <p>As noted by yvanavermaet in the comments on the question, this is an issue with Craft. It's been fixed in 3.6.5.</p>
  <p>Thanks!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-19T20:36:22.397Z
Answers.LastActivityDate: 2021-02-19T20:36:22.397Z
Answers.UserDisplayName: David Oliver
Body: <p>I have a mutation which is successfully creating an entry, but the data returned for the mutation does not include the fields I specify, such as <code>id</code>.</p>
  <pre><code>mutation saveWindowCleaningRequest($title: String!, $frontendInput: String!) {
    save_pdWindowCleaningRequests_pdWindowCleaningRequests_Entry(title: $title, siteId: 2, frontendInput: $frontendInput, authorId: 1) {
      id
      title
      ... on pdWindowCleaningRequests_pdWindowCleaningRequests_Entry {
        frontendInput
      }
    }
  }
  </code></pre>
  <p>Data returned:</p>
  <pre><code>{
    &quot;data&quot;: {
      &quot;save_pdWindowCleaningRequests_pdWindowCleaningRequests_Entry&quot;: null
    }
  }
  </code></pre>
  <p>Mutation result screenshot:</p>
  <p><a href="https://i.sstatic.net/ZYC1G.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ZYC1G.png" alt="enter image description here" /></a></p>
  <p>Subsequent entry query result screenshot, showing entry was created:</p>
  <p><a href="https://i.sstatic.net/zbRnh.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/zbRnh.png" alt="enter image description here" /></a></p>
  <p>I'm running Craft 3.5.15.1 with PostgreSQL 12.4 in Ubuntu 18.04.5 LTS.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-29T13:31:41.973Z
Comments.Text: Did you find a fix for this or logged a bug ticket on their GitHub? Currently running into the same issue. If you don't specify the siteId or use 1 it will return the fields. So must be a bug with the implementation.
Comments.UserDisplayName: yvanavermaet
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-29T14:06:11.390Z
Comments.Text: For your reference, we have created a ticket on their GitHub: https://github.com/craftcms/cms/issues/7468
Comments.UserDisplayName: yvanavermaet
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-08T10:25:00.787Z
Comments.Text: It will be fixed in the next Craft 3.6 release (unsure when or which version that will be though)
Comments.UserDisplayName: yvanavermaet
Tags: <graphql>
Title: How can I have created data (id) returned for a GraphQL mutation?
ThreadText: # How can I have created data (id) returned for a GraphQL mutation?
  
  (Asked by: username_0 on 2020-11-10)
  
  I have a mutation which is successfully creating an entry, but the data returned for the mutation does not include the fields I specify, such as `id`.
  
  ```
  mutation saveWindowCleaningRequest($title: String!, $frontendInput: String!) {
    save_pdWindowCleaningRequests_pdWindowCleaningRequests_Entry(title: $title, siteId: 2, frontendInput: $frontendInput, authorId: 1) {
      id
      title
      ... on pdWindowCleaningRequests_pdWindowCleaningRequests_Entry {
        frontendInput
      }
    }
  }
  
  ```
  
  Data returned:
  
  ```
  {
    "data": {
      "save_pdWindowCleaningRequests_pdWindowCleaningRequests_Entry": null
    }
  }
  
  ```
  
  Mutation result screenshot:
  
  [![enter image description here](https://i.sstatic.net/ZYC1G.png)](https://i.sstatic.net/ZYC1G.png)
  
  Subsequent entry query result screenshot, showing entry was created:
  
  [![enter image description here](https://i.sstatic.net/zbRnh.png)](https://i.sstatic.net/zbRnh.png)
  
  I'm running Craft 3.5.15.1 with PostgreSQL 12.4 in Ubuntu 18.04.5 LTS.
  
  **Tags:** graphql
  
  > **Comments:**
  > **username_1**: Did you find a fix for this or logged a bug ticket on their GitHub? Currently running into the same issue. If you don't specify the siteId or use 1 it will return the fields. So must be a bug with the implementation.  
  > **username_1**: For your reference, we have created a ticket on their GitHub: https://github.com/craftcms/cms/issues/7468  
  > **username_1**: It will be fixed in the next Craft 3.6 release (unsure when or which version that will be though)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-02-19. Score: 1 | Accepted answer
  
  As noted by username_1 in the comments on the question, this is an issue with Craft. It's been fixed in 3.6.5.
  
  Thanks!
  
  
  ---
  
  