Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rule): Add rule to check that id is only used for Relay IDs #40

Merged
merged 1 commit into from
Mar 7, 2023

Conversation

steverice
Copy link
Contributor

In Relay, id is treated as a reserved word and must be a globally unique value. That means when an id field is present on a type, it must be the type that Relay expects (a string type).

This linter assumes that an ID scalar is present in the schema, and checks that if an id field is present, it is using that type.

In Relay, `id` is [treated as a reserved word and must be a globally unique value](facebook/relay#1682 (comment)).
That means when an `id` field is present on a type, it must be the type that Relay expects (a string type).

This linter assumes that an `ID` scalar is present in the schema, and checks that if an `id` field is present, it is using that type.
Copy link
Contributor

@mauriciogardini mauriciogardini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok for me.

@steverice steverice merged commit 2f56901 into main Mar 7, 2023
@steverice steverice deleted the relay-id-type branch March 7, 2023 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants