Skip to content

[GraphQL] update mutation doesn't return updated entity type #2605

@nsams

Description

@nsams

An update mutation returns as payload all fields of the updated entity. But it doesn't return the entity itself, which prevents the client (apollo in my case) to update the cache.

Example of a simple api-platform mutation:

input updateUserInput {
  id: ID!
  name: String
  clientMutationId: String!
}

type updateUserPayload {
  id: ID!
  name: String
  clientMutationId: String!
}

mutation UpdateUser($input: updateUserInput!) {
  updateUser(input: $input) {
    id
    name
    clientMutationId
  }
}

As reference,
https://facebook.github.io/relay/docs/en/graphql-server-specification.html#mutations does return a nested ship and fraction with their type

and https://facebook.github.io/relay/graphql/mutations.htm also has a nested status (it's type is not visible here though)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions