hey, walking through the basic tutorials and gotten stuck on how to debug my Predicate functions for each role.
Essentially, I’m setting the permissions for a for a user to “Create” a recipe.
I’ve “logged in” as a user and am using their auth token, and try to run this query, which works just fine when I blanket allow create access from users to recipes.
`mutation{
createRecipe(data:{
title: "Green Curry"
description: "a normal curry"
instructions: "dummy instructions"
user:{
connect:"<user ID>"
}
}){
_id
}
}`
I get the “permission denied” error. I’ve tried every possible recombination, but this is really hard to debug without seeing how my graphQL request is being resolved into a create request in FQL.
even weirder, a similar predicate is being applied to the “READ” permission for the same role for the same document and it works fine
Thanks @ptpaterson - I have those permissions set as you show above, didn’t work. also read the attached thread.
even with my permissions set so openly like this, I still am unable to perform the operation. It might have to do with how the data is being passed for that given user nested?
more Schema details, there are no resolver functions for this, it’s just the default resolvers FaunaDB seems to use for mutations when autogenerated from a basic schema
Still not totally “Solved” but it seems that one of my schema updates must have decoupled one of the default resolver functions, so it was literally pasting the object {connect:"<id>"} in the chef param of the document… eventually after another update it returned the error “expecting set or ref, found Object”
sooo I had to override the schema, rebuild everything from scratch, and now it works like a charm.
the final schema which I uploaded and was heavily filled out by autofill (users changed to “chef” for flair):