-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Foreign keys on non-null columns should produce nullable GraphQL relationships due to RLS #409
Labels
bug
Something isn't working
Comments
Just verified that this indeed is the current behavior. |
olirice
added
bug
Something isn't working
and removed
triage-required
Pending triage from maintainers
labels
Aug 23, 2023
great point we'll have to make it nullable when RLS is enabled |
Thanks so much for all the great work you've done on |
Expanding the scope on this to:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In version 1.2.3, a bugfix was introduced to make relationships non-nullable if the foreign key column is non-nullable.
However due to RLS, it is possible that a non-nullable foreign key column produces a relationship that returns
null
.My team recently faced this as we're building an access-control system that limits which entities a user can access. e.g. a user might have access to an entity with a non-nullable foreign key field
subsystemId
, but the administrator may disable view access to that specific subsystem. When performing the query:...the user will receive
subsystemId: "a5ff110a-4d69-4ea5-af83-d02086e9215f"
, but RLS prevents them from viewing the data onSubsystem:a5ff110a-4d69-4ea5-af83-d02086e9215f
, resulting in the response:Expected behavior
All GraphQL relationships should default to nullable, or a configuration setting should be provided to opt-in to nullable relationships by default.
The text was updated successfully, but these errors were encountered: