added query to check if current user is logged in

This commit is contained in:
Djeeberjr 2021-09-15 01:00:26 +02:00
parent af488ab5fe
commit 9f280caafc

View File

@ -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{