facebook / facebook/relay

MockPayloadGenerator does not support Client Resolvers

Open
#4,881 0 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

I have found `MockPayloadGenerator` does not support client resolvers. I have tried mocking `Query` and providing mocks for the specific type. Neither of these works. Similarly if I return an object from `queueOperationResolver` without using the MockPayloadGenerator e.g.

```js
{
data: {
viewer: {
id: 'viewer',
localPlayerQueue: {
currentIndex: 4,
},
},
},
}
```

It also fails to contain the client resolver values in this case `localPlayerQueue`.

I can mock out the reactive store which the resolvers use and this works, however If I have Server return types, these fail to resolve unless I manually add the records in to the store.

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.