facebook / facebook/relay

[modern] Mutation required children (replace null node through mutation)

Open
#1,906 3 comments 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 everyone,

I’ve been searching through the documentation for an example when you’re performing a mutation which returns a single previously unset/unused node; which I believe used to be called `REQUIRED_CHILDREN`.

For example, say we have a `currentUser` field, which is a `UserNode`:
```
query {
currentUser: null
}
```

We now perform a mutation, say a login action of some sort, which would cause our `currentUser` node to change based on the mutation payload:
```
query {
currentUser: {
id
name
lastLogin
}
}
```

How would a mutation method look to handle this data change; as it needs to be reflected in the UI?

Thank you in advance.

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.