facebook / facebook/relay

Unexpected Name "mutations"

Open
#2,159 1 comment 0 reactions 0 assignees View on GitHub
wontfix
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

hi:
i use relay mutation in order to create ,but struggle an problem

this is my mutation:
```
`
const mutation = graphql`
mutation createCourseMutation(
$input: CreateCourseMutationInput!
) {
createCourse(input : $input) {
course {
id
name
desc
detail
image
degree
category
}
}
}
`;
```
`
but the data which is received by server from client is as follows:

```
**mutations** createCourseMutation(
$input: CreateCourseMutationInput!
) {
createCourse(input: $input) {
course {
id
name
desc
detail
image
degree
category
}
}
}
```

so the error is:
`Syntax Error GraphQL request (1:1) Unexpected Name "mutations"`

I don't understand why the mutation in graphql tag become mutations,

thanks

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.