Closed saihaj closed 2 years ago
directive @skipAuth on FIELD_DEFINITION type Query { info: String! @skipAuth me: User! @skipAuth } type Mutation { login(email: String!, password: String!): AuthPayload @skipAuth } type AuthPayload { token: String user: User } type User { id: ID! name: String! email: String! links: [Link!]! }
So if I try to get info or me everything is working as i expect. But when I run login mutation to get token I get unauthenticated error on
"path": [ "login", "token" ]
Makes sense, because the @skipAuth is not applied on the fields that are selected by the operation?
@skipAuth
If I add to type shouldn't that apply to all the types?
type
wait nvm FIELD_DEFINITION
FIELD_DEFINITION
So if I try to get info or me everything is working as i expect. But when I run login mutation to get token I get unauthenticated error on