2024-11-01 17:49:56 +00:00
|
|
|
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
|
|
|
|
|
|
|
|
package generated
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"errors"
|
|
|
|
"strconv"
|
|
|
|
"sync/atomic"
|
|
|
|
|
|
|
|
"github.com/99designs/gqlgen/graphql"
|
|
|
|
"github.com/vektah/gqlparser/v2/ast"
|
|
|
|
"gitserver.in/patialtech/rano/graph/model"
|
|
|
|
)
|
|
|
|
|
|
|
|
// region ************************** generated!.gotpl **************************
|
|
|
|
|
|
|
|
// endregion ************************** generated!.gotpl **************************
|
|
|
|
|
|
|
|
// region ***************************** args.gotpl *****************************
|
|
|
|
|
|
|
|
// endregion ***************************** args.gotpl *****************************
|
|
|
|
|
|
|
|
// region ************************** directives.gotpl **************************
|
|
|
|
|
|
|
|
// endregion ************************** directives.gotpl **************************
|
|
|
|
|
|
|
|
// region **************************** field.gotpl *****************************
|
|
|
|
|
|
|
|
func (ec *executionContext) _AuthUser_id(ctx context.Context, field graphql.CollectedField, obj *model.AuthUser) (ret graphql.Marshaler) {
|
|
|
|
fc, err := ec.fieldContext_AuthUser_id(ctx, field)
|
|
|
|
if err != nil {
|
|
|
|
return graphql.Null
|
|
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
|
|
defer func() {
|
|
|
|
if r := recover(); r != nil {
|
|
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
|
|
ret = graphql.Null
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
|
|
ctx = rctx // use context from middleware stack in children
|
|
|
|
return obj.ID, nil
|
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
ec.Error(ctx, err)
|
|
|
|
return graphql.Null
|
|
|
|
}
|
|
|
|
if resTmp == nil {
|
|
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
|
|
ec.Errorf(ctx, "must not be null")
|
|
|
|
}
|
|
|
|
return graphql.Null
|
|
|
|
}
|
|
|
|
res := resTmp.(string)
|
|
|
|
fc.Result = res
|
2024-11-17 16:58:29 +00:00
|
|
|
return ec.marshalNUID2string(ctx, field.Selections, res)
|
2024-11-01 17:49:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (ec *executionContext) fieldContext_AuthUser_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
|
|
fc = &graphql.FieldContext{
|
|
|
|
Object: "AuthUser",
|
|
|
|
Field: field,
|
|
|
|
IsMethod: false,
|
|
|
|
IsResolver: false,
|
|
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
2024-11-17 16:58:29 +00:00
|
|
|
return nil, errors.New("field of type UID does not have child fields")
|
2024-11-01 17:49:56 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
return fc, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ec *executionContext) _AuthUser_email(ctx context.Context, field graphql.CollectedField, obj *model.AuthUser) (ret graphql.Marshaler) {
|
|
|
|
fc, err := ec.fieldContext_AuthUser_email(ctx, field)
|
|
|
|
if err != nil {
|
|
|
|
return graphql.Null
|
|
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
|
|
defer func() {
|
|
|
|
if r := recover(); r != nil {
|
|
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
|
|
ret = graphql.Null
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
|
|
ctx = rctx // use context from middleware stack in children
|
|
|
|
return obj.Email, nil
|
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
ec.Error(ctx, err)
|
|
|
|
return graphql.Null
|
|
|
|
}
|
|
|
|
if resTmp == nil {
|
|
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
|
|
ec.Errorf(ctx, "must not be null")
|
|
|
|
}
|
|
|
|
return graphql.Null
|
|
|
|
}
|
|
|
|
res := resTmp.(string)
|
|
|
|
fc.Result = res
|
|
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ec *executionContext) fieldContext_AuthUser_email(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
|
|
fc = &graphql.FieldContext{
|
|
|
|
Object: "AuthUser",
|
|
|
|
Field: field,
|
|
|
|
IsMethod: false,
|
|
|
|
IsResolver: false,
|
|
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
|
|
},
|
|
|
|
}
|
|
|
|
return fc, nil
|
|
|
|
}
|
|
|
|
|
2024-11-17 16:58:29 +00:00
|
|
|
func (ec *executionContext) _AuthUser_name(ctx context.Context, field graphql.CollectedField, obj *model.AuthUser) (ret graphql.Marshaler) {
|
|
|
|
fc, err := ec.fieldContext_AuthUser_name(ctx, field)
|
2024-11-01 17:49:56 +00:00
|
|
|
if err != nil {
|
|
|
|
return graphql.Null
|
|
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
|
|
defer func() {
|
|
|
|
if r := recover(); r != nil {
|
|
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
|
|
ret = graphql.Null
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
|
|
ctx = rctx // use context from middleware stack in children
|
2024-11-17 16:58:29 +00:00
|
|
|
return obj.Name, nil
|
2024-11-01 17:49:56 +00:00
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
ec.Error(ctx, err)
|
|
|
|
return graphql.Null
|
|
|
|
}
|
|
|
|
if resTmp == nil {
|
|
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
|
|
ec.Errorf(ctx, "must not be null")
|
|
|
|
}
|
|
|
|
return graphql.Null
|
|
|
|
}
|
|
|
|
res := resTmp.(string)
|
|
|
|
fc.Result = res
|
|
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
|
|
}
|
|
|
|
|
2024-11-17 16:58:29 +00:00
|
|
|
func (ec *executionContext) fieldContext_AuthUser_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
2024-11-01 17:49:56 +00:00
|
|
|
fc = &graphql.FieldContext{
|
|
|
|
Object: "AuthUser",
|
|
|
|
Field: field,
|
|
|
|
IsMethod: false,
|
|
|
|
IsResolver: false,
|
|
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
|
|
},
|
|
|
|
}
|
|
|
|
return fc, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ec *executionContext) _AuthUser_roleID(ctx context.Context, field graphql.CollectedField, obj *model.AuthUser) (ret graphql.Marshaler) {
|
|
|
|
fc, err := ec.fieldContext_AuthUser_roleID(ctx, field)
|
|
|
|
if err != nil {
|
|
|
|
return graphql.Null
|
|
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
|
|
defer func() {
|
|
|
|
if r := recover(); r != nil {
|
|
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
|
|
ret = graphql.Null
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
|
|
ctx = rctx // use context from middleware stack in children
|
|
|
|
return obj.RoleID, nil
|
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
ec.Error(ctx, err)
|
|
|
|
return graphql.Null
|
|
|
|
}
|
|
|
|
if resTmp == nil {
|
|
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
|
|
ec.Errorf(ctx, "must not be null")
|
|
|
|
}
|
|
|
|
return graphql.Null
|
|
|
|
}
|
|
|
|
res := resTmp.(int)
|
|
|
|
fc.Result = res
|
|
|
|
return ec.marshalNInt2int(ctx, field.Selections, res)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ec *executionContext) fieldContext_AuthUser_roleID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
|
|
fc = &graphql.FieldContext{
|
|
|
|
Object: "AuthUser",
|
|
|
|
Field: field,
|
|
|
|
IsMethod: false,
|
|
|
|
IsResolver: false,
|
|
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
|
|
return nil, errors.New("field of type Int does not have child fields")
|
|
|
|
},
|
|
|
|
}
|
|
|
|
return fc, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// endregion **************************** field.gotpl *****************************
|
|
|
|
|
|
|
|
// region **************************** input.gotpl *****************************
|
|
|
|
|
|
|
|
// endregion **************************** input.gotpl *****************************
|
|
|
|
|
|
|
|
// region ************************** interface.gotpl ***************************
|
|
|
|
|
|
|
|
// endregion ************************** interface.gotpl ***************************
|
|
|
|
|
|
|
|
// region **************************** object.gotpl ****************************
|
|
|
|
|
|
|
|
var authUserImplementors = []string{"AuthUser"}
|
|
|
|
|
|
|
|
func (ec *executionContext) _AuthUser(ctx context.Context, sel ast.SelectionSet, obj *model.AuthUser) graphql.Marshaler {
|
|
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, authUserImplementors)
|
|
|
|
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
|
|
deferred := make(map[string]*graphql.FieldSet)
|
|
|
|
for i, field := range fields {
|
|
|
|
switch field.Name {
|
|
|
|
case "__typename":
|
|
|
|
out.Values[i] = graphql.MarshalString("AuthUser")
|
|
|
|
case "id":
|
|
|
|
out.Values[i] = ec._AuthUser_id(ctx, field, obj)
|
|
|
|
if out.Values[i] == graphql.Null {
|
|
|
|
out.Invalids++
|
|
|
|
}
|
|
|
|
case "email":
|
|
|
|
out.Values[i] = ec._AuthUser_email(ctx, field, obj)
|
|
|
|
if out.Values[i] == graphql.Null {
|
|
|
|
out.Invalids++
|
|
|
|
}
|
2024-11-17 16:58:29 +00:00
|
|
|
case "name":
|
|
|
|
out.Values[i] = ec._AuthUser_name(ctx, field, obj)
|
2024-11-01 17:49:56 +00:00
|
|
|
if out.Values[i] == graphql.Null {
|
|
|
|
out.Invalids++
|
|
|
|
}
|
|
|
|
case "roleID":
|
|
|
|
out.Values[i] = ec._AuthUser_roleID(ctx, field, obj)
|
|
|
|
if out.Values[i] == graphql.Null {
|
|
|
|
out.Invalids++
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
out.Dispatch(ctx)
|
|
|
|
if out.Invalids > 0 {
|
|
|
|
return graphql.Null
|
|
|
|
}
|
|
|
|
|
|
|
|
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
|
|
|
|
|
|
|
|
for label, dfs := range deferred {
|
|
|
|
ec.processDeferredGroup(graphql.DeferredGroup{
|
|
|
|
Label: label,
|
|
|
|
Path: graphql.GetPath(ctx),
|
|
|
|
FieldSet: dfs,
|
|
|
|
Context: ctx,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
return out
|
|
|
|
}
|
|
|
|
|
|
|
|
// endregion **************************** object.gotpl ****************************
|
|
|
|
|
|
|
|
// region ***************************** type.gotpl *****************************
|
|
|
|
|
2024-11-15 16:12:15 +00:00
|
|
|
func (ec *executionContext) marshalNAuthUser2gitserverᚗinᚋpatialtechᚋranoᚋgraphᚋmodelᚐAuthUser(ctx context.Context, sel ast.SelectionSet, v model.AuthUser) graphql.Marshaler {
|
|
|
|
return ec._AuthUser(ctx, sel, &v)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ec *executionContext) marshalNAuthUser2ᚖgitserverᚗinᚋpatialtechᚋranoᚋgraphᚋmodelᚐAuthUser(ctx context.Context, sel ast.SelectionSet, v *model.AuthUser) graphql.Marshaler {
|
|
|
|
if v == nil {
|
|
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
|
|
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
|
|
|
}
|
|
|
|
return graphql.Null
|
|
|
|
}
|
|
|
|
return ec._AuthUser(ctx, sel, v)
|
|
|
|
}
|
|
|
|
|
2024-11-01 17:49:56 +00:00
|
|
|
func (ec *executionContext) marshalOAuthUser2ᚖgitserverᚗinᚋpatialtechᚋranoᚋgraphᚋmodelᚐAuthUser(ctx context.Context, sel ast.SelectionSet, v *model.AuthUser) graphql.Marshaler {
|
|
|
|
if v == nil {
|
|
|
|
return graphql.Null
|
|
|
|
}
|
|
|
|
return ec._AuthUser(ctx, sel, v)
|
|
|
|
}
|
|
|
|
|
|
|
|
// endregion ***************************** type.gotpl *****************************
|