amplify-category-api
amplify-category-api copied to clipboard
Don't show this warning if static group auth is used
I'm using @auth on functions, e.g.:
type Query {
helloWorld(): String @function(name: "HelloWorldResolver-${env}") @auth(rules: [{ allow: groups, groups: ["MyGroup"] }])
}
Then I get this warning on push:
Be careful when using @auth directives on a field in a root type. @auth directives on field definitions use the source object to perform authorization logic and the source will be an empty object for fields on root types. Static group authorization should perform as expected.
Since I am using static group auth, the warning is not needed, and just becomes noise.
@hisham Did you get an answer to the warning?
No
Also annoyed by this warning. Is this still a thing in the latest CLI versions? Currently on 6.3.1
Also annoyed by this warning. Is this still a thing in the latest CLI versions? Currently on 6.3.1
Yes, annoyed by this using the amplify-cli version 10.6.0.
Seeing this in 12.10.1 as well, would love a way to suppress this