facebook / facebook/relay

onCompleted response field not raw as documented

Open
#2,250 4 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

The docs say the `response` arg in the onCompleted callback is the raw server response.
However, it's really just coming from a snapshot.
This is usually fine, unless my mutation payload includes a fragment, then it barfs because it does the standard colocating only-resolve-what-you-need thing & i end up with an object like `{_fragments: {Foo_foo: {}}}`.

This is related to #1995 as it's part of the bigger issue of writing maintainable mutations. If we can't use fragments in our mutations, that should probably be noted in the docs. (and hopefully there's a useful pattern to share so my requested mutation payload is an aggregate function of my query fields).

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.