AshGraphQL cannot return null on non nullable field

I have a belongs_to allow_nil? false relationship, and when I use psql I see that the field exists, and the related table contains the data. However when I use graphql to access it I get Cannot return null for non-nullable field
Solution:
do you have permission to read the related record?
Jump to solution
7 Replies
Vahagn
VahagnOP4mo ago
They both have defaults [:read] in actions the relationship is public
Solution
sevenseacat
sevenseacat4mo ago
do you have permission to read the related record?
Vahagn
VahagnOP4mo ago
there are no policies defined only default ash_auth ones
policies do
bypass AshAuthentication.Checks.AshAuthenticationInteraction do
authorize_if always()
end

policy always() do
forbid_if always()
end
end
policies do
bypass AshAuthentication.Checks.AshAuthenticationInteraction do
authorize_if always()
end

policy always() do
forbid_if always()
end
end
haven't read anything on them yet, can this be a problem?
sevenseacat
sevenseacat4mo ago
absolutely
Vahagn
VahagnOP4mo ago
:((
sevenseacat
sevenseacat4mo ago
everything is forbidden
Vahagn
VahagnOP4mo ago
thanks will look into it

Did you find this page helpful?