Open mjza opened 3 years ago
Also for type String it happen only when value is provided, so length does not check in null
How can I check for not null?
categoryId: ID
@assert(condition: ". != null")
@auth(
rules: [
{ allow: owner, provider: userPools, operations: [create, update, read] }
{
allow: groups
groups: ["Supers", "Admins", "Employees"]
provider: userPools
operations: [create, update, read]
}
]
)
Does not work!
You just need to require it in GraphQL:
categoryId: ID!
@auth(
rules: [
{ allow: owner, provider: userPools, operations: [create, update, read] }
{
allow: groups
groups: ["Supers", "Admins", "Employees"]
provider: userPools
operations: [create, update, read]
}
]
)
using exclamation mark after the field type.
I need to check the value has been provided for a Id, but I cannot define it as mandatory to be able to define auth:
But the assertion only file when user provides something, it means null is acceptable