diff --git a/internal/schema.go b/internal/schema.go index f73c5bc..640bafa 100644 --- a/internal/schema.go +++ b/internal/schema.go @@ -87,6 +87,16 @@ func graphqlSchema() (graphql.Schema, error) { }, nil }, }, + "authorized": &graphql.Field{ + Name: "authorized", + Type: graphql.NewNonNull(graphql.Boolean), + Description: "True if the user is authorized", + Resolve: func(p graphql.ResolveParams) (interface{}, error) { + auth, _ := isAuth(p.Context) + + return auth, nil + }, + }, } mutationFields := graphql.Fields{