Cryptic error when defining a mutation without documentation or reference
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Normally relay compile errors are informative and provide enough instruction to resolve. In this case I've added the following mutation query to relay and I've received a cryptic error, I cannot find any reference to this on google, github, discord, slack overflow, relay documentation.
I think it should have a reference in the documentation
```
[ERROR] ✖︎ After transforms, the operation `CardUpdateRichTextMutation` that would be sent to the server is empty. Relay is not setup to handle such queries. This is likely due to only querying for client extension fields or `@skip`/`@include` directives with constant values that remove all selections.
```
After adding
```
const [commit, isInFlight] = useMutation(graphql`
mutation CardUpdateRichTextMutation($input: UpdateRichText!) {
updateRichText(input: $input) {
id
}
}
`)
```
schema
```
mutation {updateRichText(input: UpdateRichText!): Output }
input UpdateRichText {
id: ID!
patch: updateRichTextInput!
}
input updateRichTextInput {
somefields...
}
type Output {
id: ID
}
```
Contributor guide
Research direction
Start by reproducing the shown CardUpdateRichTextMutation and reviewing the reported Relay compile error alongside the mutation and schema examples in this issue. Document what the error means, the conditions that trigger it, and how a user can resolve or avoid it; done means the error has a clear reference in the Relay documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, javascript, react
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- Half a day
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100