facebook / facebook/relay

TypeScript: Property 'invalidateStore' does not exist on type 'RecordSourceProxy'

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

Description

When using `commitLocalUpdate` to invalidate the store the TS compiler throws and error:

```
Property 'invalidateStore' does not exist on type 'RecordSourceProxy'
```

You can reproduce by writing the following in a TypeScript project:

```
commitLocalUpdate(relayEnvironment, (store : RecordSourceProxy) => {
store.invalidateStore(); // Property 'invalidateStore' does not exist on type 'RecordSourceProxy'
});
```

I believe that `RecordSourceProxy` needs to be updated in `updater: StoreUpdater` to `RecordSourceSelectorProxy`.

If someone points me in the right direction on where to make this change, I can make a PR.

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.