facebook / facebook/relay

[relay-compiler] Local persist does not delete old versions of query

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

Description

I recently set up local persisted queries and noticed that subsequent updates seem to be additive vs replacing the existing queries in the persisted config

Example:
If i have a `TestQuery` which gets saved in the persisted config as
```
"12345": "query TestQuery..."
```

and i later make a change to `TestQuery` and rerun relay-compiler, my json file will look like:
```
"12345": "query TestQuery...", <-- this is the old version of my query
"23456": "query TestQuery..." <-- this is the new version of my query
```

The only way I've found to generate a "fresh" copy of the json file is to first delete the json file and then run relay compiler with the `--repersist` flag.

Wanted to validate if this is expected behavior or not (could not find anything in the docs or source code to confirm this).

Thanks 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.