relay-compiler: do not auto-add ID field if deprecated
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Hello 👋
For some historical reasons we have in our GQL server a Mutation Payload with an `id` field corresponding to the modified object.
Of course, we know it's not the way to do it as it then give the same ID to 2 objects in the graph, which is not a good idea.
After realizing it, we've deprecated the `id` field in favour of a correctly named one, we've changed clients to reflect that change.
But we realize that the relay compiler still add the id even if not explicitly asked for, and even if the field is deprecated.
Would it be possible to NOT auto-add it if it's deprecated?
I believe the code is around here https://github.com/facebook/relay/blob/7ee39e40258e11bc24156e74b5fdeaa01eb73a64/packages/relay-compiler/transforms/GenerateIDFieldTransform.js#L134
Contributor guide
Assessment
This issue has not been assessed yet.