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

Method _Query

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

Source from the content-addressed store, hash-verified

3152var queryImplementors = []string{"Query"}
3153
3154func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
3155 fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors)
3156 ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
3157 Object: "Query",
3158 })
3159
3160 out := graphql.NewFieldSet(fields)
3161 var invalids uint32
3162 for i, field := range fields {
3163 innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{
3164 Object: field.Name,
3165 Field: field,
3166 })
3167
3168 switch field.Name {
3169 case "__typename":
3170 out.Values[i] = graphql.MarshalString("Query")
3171 case "categories":
3172 field := field
3173
3174 innerFunc := func(ctx context.Context) (res graphql.Marshaler) {
3175 defer func() {
3176 if r := recover(); r != nil {
3177 ec.Error(ctx, ec.Recover(ctx, r))
3178 }
3179 }()
3180 res = ec._Query_categories(ctx, field)
3181 if res == graphql.Null {
3182 atomic.AddUint32(&invalids, 1)
3183 }
3184 return res
3185 }
3186
3187 rrm := func(ctx context.Context) graphql.Marshaler {
3188 return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc)
3189 }
3190
3191 out.Concurrently(i, func() graphql.Marshaler {
3192 return rrm(innerCtx)
3193 })
3194 case "courses":
3195 field := field
3196
3197 innerFunc := func(ctx context.Context) (res graphql.Marshaler) {
3198 defer func() {
3199 if r := recover(); r != nil {
3200 ec.Error(ctx, ec.Recover(ctx, r))
3201 }
3202 }()
3203 res = ec._Query_courses(ctx, field)
3204 if res == graphql.Null {
3205 atomic.AddUint32(&invalids, 1)
3206 }
3207 return res
3208 }
3209
3210 rrm := func(ctx context.Context) graphql.Marshaler {
3211 return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc)

Callers 1

ExecMethod · 0.95

Calls 5

_Query_categoriesMethod · 0.95
_Query_coursesMethod · 0.95
_Query___typeMethod · 0.95
_Query___schemaMethod · 0.95
DispatchMethod · 0.65

Tested by

no test coverage detected