Open 6TELOIV opened 2 hours ago
Initial investigation and details present in this discord thread: https://discord.com/channels/967097582721572934/1307023111056785418
It seems to maybe be an inconsistent issue, but that min repro seems to consistently have the issue.
Describe the Bug
When using access control to restrict access to a collection, the GraphQL api will give errors and not return the correct data if some but not all records are denied readability in a
relation
field with many related records.If all are read-allowed, it works fine. If all are denied, it's also fine. But if some are allowed and some are not, it returns null for the entire field.
Link to the code that reproduces this issue
https://github.com/6TELOIV/graphql-null-relations
Reproduction Steps
DemoGlobal
, add multiple relatedDemo
items, checkingvisible
on some but not others.localhost:3000/api/graphql-playground
in a private window/logged out contextObserve the error:
Error: Cannot return null for non-nullable field DemoGlobal.demoRelationship.
Which area(s) are affected? (Select all that apply)
area: core, db-postgres
Environment Info