Skip to content

GraphQL __typename response on mutations differs in some cases #4925

@Birnsen

Description

@Birnsen

What version of Dgraph are you using?

v2.0.0-beta (Docker image)

Have you tried reproducing the issue with the latest release?

Yes

What is the hardware spec (RAM, OS)?

RAM: 16GB
Linux

Steps to reproduce the issue (command/config used to run Dgraph).

I use the Altair GraphQL Client for the Requests

Schema:

type Stuff {
  id: ID!
  title: String!
  user: String!
}

Mutation Request 1:

mutation m {
  addStuff(input: [
    { title: "Hello World!", user: "birnsen"}
  ])
  {
    __typename
  }
}

Response 1:

{
  "data": {
    "addStuff": {
      "__typename": "AddStuffPayload"
    }
  }
}

Mutation Request 2:

mutation m {
  addStuff(input: [
    { title: "Hello World!", user: "birnsen"}
  ])
  {
    stuff {
      id
      __typename
    }
    __typename
  }
}

Response 2:

{
  "data": {
    "addStuff": {
      "stuff": [
        {
          "id": "0x3",
          "__typename": "Stuff"
        }
      ]
    }
  }
}

Expected behaviour and actual result.

I expected that the second request returned with:

{
  "data": {
    "addStuff": {
      "stuff": [
        {
          "id": "0x3",
          "__typename": "Stuff"
        }
      ],
      "__typename": "AddStuffPayload"
    }
  }
}

Thread on discuss: https://discuss.dgraph.io/t/graphql-typename-response-on-mutations-differs-in-some-cases/6112

Metadata

Metadata

Labels

area/graphqlIssues related to GraphQL support on Dgraph.kind/bugSomething is broken.status/acceptedWe accept to investigate/work on it.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions