MCPcopy Create free account
hub / github.com/devfullcycle/goexpert / _Mutation

Method _Mutation

13-GraphQL/graph/generated/generated.go:3106–3150  ·  view source on GitHub ↗
(ctx context.Context, sel ast.SelectionSet)

Source from the content-addressed store, hash-verified

3104var mutationImplementors = []string{"Mutation"}
3105
3106func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
3107 fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors)
3108 ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
3109 Object: "Mutation",
3110 })
3111
3112 out := graphql.NewFieldSet(fields)
3113 var invalids uint32
3114 for i, field := range fields {
3115 innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{
3116 Object: field.Name,
3117 Field: field,
3118 })
3119
3120 switch field.Name {
3121 case "__typename":
3122 out.Values[i] = graphql.MarshalString("Mutation")
3123 case "createCategory":
3124
3125 out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
3126 return ec._Mutation_createCategory(ctx, field)
3127 })
3128
3129 if out.Values[i] == graphql.Null {
3130 invalids++
3131 }
3132 case "createCourse":
3133
3134 out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
3135 return ec._Mutation_createCourse(ctx, field)
3136 })
3137
3138 if out.Values[i] == graphql.Null {
3139 invalids++
3140 }
3141 default:
3142 panic("unknown field " + strconv.Quote(field.Name))
3143 }
3144 }
3145 out.Dispatch()
3146 if invalids > 0 {
3147 return graphql.Null
3148 }
3149 return out
3150}
3151
3152var queryImplementors = []string{"Query"}
3153

Callers 1

ExecMethod · 0.95

Calls 3

DispatchMethod · 0.65

Tested by

no test coverage detected