99designs / 99designs/gqlgen

`mutation` with duplicate fields does not throw validation error

Open
#3,066 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
10.8k
Forks
1.3k
Avg merge
2d 36m
Merged PRs (30d)
26

Description

### What happened?

The following mutation:

```graphql
mutation {
evaluate(
expressions: {
date: "1"
}
)
evaluate(
expressions: {
date: "2"
}
)
}
```

Executes first mutation field only and returns:

```json
{
"data": {
"evaluate": {
"date": 1
}
}
}
```

### What did you expect?

An error similar to how `query` behaves. IE

```
Fields \"evaluate\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.
```

The spec may have some definition of how this should be handled. Regardless, only executing one of the two mutations was unexpected.

### Versions

`v0.17.37`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.