added query to check if current user is logged in
This commit is contained in:
parent
af488ab5fe
commit
9f280caafc
@ -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{
|
||||
|
Loading…
Reference in New Issue
Block a user