facebook / facebook/relay

Client Resolvers with Server edges are not making client edge requests

Open
#4,882 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Im experiencing some inconsistent behaviour when using client resolvers with Server Edges.
Components which are provided fragments can be observed to not have data they are requesting.

The issue appears to be when using Server Edges in combination with fragments. The client edge query is only actioned when the data is requested in the field with the `@waterfall` directive is not available in the store. If that field uses a fragment, data within the fragment is not requested if it is not in the store.

For example a query referencing a fragment with:

```js
query PlayerQuery {
items {
cloudcast @waterfall {
id,
...PlayerItem
}
}
}
```

```js
fragment PlayerItem_cloudcast on cloudcast {
name
owner{
displayName
}
}
```

In this example the owner.displayName does not trigger an client edge query. However if it was written as below it would:

```js
query PlayerQuery {
items {
cloudcast @waterfall {
id,
owner{
displayName
}
...PlayerItem
}
}
}
```

It appears that the fragment data is not inspected when making client edge requests

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.