`relay-compiler --validate` not working properly with persisted query generation
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
When `relay-compiler --validate` is run, typically any incorrect or missing artifacts lead to a non-zero exit code and no changes to the filesystem. I use this in a github workflow to ensure that the author ran `relay` before submitting the PR.
However, with persisted queries, it silently regenerates the file instead, and does not give any error.
I would expect any mismatches to not modify the filesystem, and instead exit with non-zero exit code. Otherwise a PR can corrupt this file without any validation error being flagged.
Additionally if possible, I would like for this comparison to ignore the order of keys in the file, although perhaps thats a separate discussion. My relay scripts sort the persisted queries by query name to minimize merge conflicts from query hashes moving around, so that would trigger an error potentially. Perhaps this should be built-in as a config option for generating the persisted queries file though.
Contributor guide
Assessment
This issue has not been assessed yet.