2023-07-21 15:16:35 -06:00
|
|
|
package graphvent
|
|
|
|
import (
|
|
|
|
"github.com/graphql-go/graphql"
|
|
|
|
)
|
|
|
|
|
2023-07-21 17:49:19 -06:00
|
|
|
var GQLQuerySelf = &graphql.Field{
|
2023-07-26 20:26:41 -06:00
|
|
|
Type: GQLInterfaceThread.Default,
|
2023-07-21 17:49:19 -06:00
|
|
|
Resolve: func(p graphql.ResolveParams) (interface{}, error) {
|
2023-07-26 15:52:40 -06:00
|
|
|
_, ctx, err := PrepResolve(p)
|
2023-07-21 17:49:19 -06:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2023-07-21 15:16:35 -06:00
|
|
|
|
2023-07-21 18:51:42 -06:00
|
|
|
return ctx.Server, nil
|
2023-07-21 17:49:19 -06:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
var GQLQueryUser = &graphql.Field{
|
2023-07-26 20:26:41 -06:00
|
|
|
Type: GQLInterfaceNode.Default,
|
2023-07-21 17:49:19 -06:00
|
|
|
Resolve: func(p graphql.ResolveParams) (interface{}, error) {
|
2023-07-26 15:52:40 -06:00
|
|
|
_, ctx, err := PrepResolve(p)
|
2023-07-21 17:49:19 -06:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2023-07-21 15:16:35 -06:00
|
|
|
|
2023-07-21 18:51:42 -06:00
|
|
|
return ctx.User, nil
|
2023-07-21 17:49:19 -06:00
|
|
|
},
|
2023-07-21 15:16:35 -06:00
|
|
|
}
|