facebook / facebook/relay

relay-compiler: do not auto-add ID field if deprecated

Open
#3,617 4 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

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

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.