amplify-category-api icon indicating copy to clipboard operation
amplify-category-api copied to clipboard

Don't show this warning if static group auth is used

Open hisham opened this issue 4 years ago • 5 comments

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 avatar Aug 11 '20 20:08 hisham

@hisham Did you get an answer to the warning?

elankeeran avatar Jun 12 '22 21:06 elankeeran

No

hisham avatar Jun 12 '22 22:06 hisham

Also annoyed by this warning. Is this still a thing in the latest CLI versions? Currently on 6.3.1

james-e-morris avatar Jan 07 '23 02:01 james-e-morris

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.

kimmosaarinen avatar Jan 07 '23 10:01 kimmosaarinen

Seeing this in 12.10.1 as well, would love a way to suppress this

NickDario avatar Apr 04 '24 18:04 NickDario