How to use ___Schema method of generated Package

Best Keploy code snippet using generated.___Schema

gql.go

Source:gql.go Github

copy

Full Screen

...256 res := ec.introspectSchema()257 if res == nil {258 return graphql.Null259 }260 return ec.___Schema(field.Selections, res)261}262func (ec *executionContext) _Query___type(field graphql.CollectedField) graphql.Marshaler {263 var arg0 string264 if tmp, ok := field.Args["name"]; ok {265 var err error266 arg0, err = graphql.UnmarshalString(tmp)267 if err != nil {268 ec.Error(err)269 return graphql.Null270 }271 }272 res := ec.introspectType(arg0)273 if res == nil {274 return graphql.Null275 }276 return ec.___Type(field.Selections, res)277}278var todoImplementors = []string{"Todo"}279// nolint: gocyclo, errcheck, gas, goconst280func (ec *executionContext) _Todo(sel []query.Selection, obj *data.Todo) graphql.Marshaler {281 fields := graphql.CollectFields(ec.doc, sel, todoImplementors, ec.variables)282 out := graphql.NewOrderedMap(len(fields))283 for i, field := range fields {284 out.Keys[i] = field.Alias285 switch field.Name {286 case "__typename":287 out.Values[i] = graphql.MarshalString("Todo")288 case "id":289 out.Values[i] = ec._Todo_id(field, obj)290 case "text":291 out.Values[i] = ec._Todo_text(field, obj)292 case "done":293 out.Values[i] = ec._Todo_done(field, obj)294 default:295 panic("unknown field " + strconv.Quote(field.Name))296 }297 }298 return out299}300func (ec *executionContext) _Todo_id(field graphql.CollectedField, obj *data.Todo) graphql.Marshaler {301 res := obj.ID302 return graphql.MarshalInt(res)303}304func (ec *executionContext) _Todo_text(field graphql.CollectedField, obj *data.Todo) graphql.Marshaler {305 res := obj.Text306 return graphql.MarshalString(res)307}308func (ec *executionContext) _Todo_done(field graphql.CollectedField, obj *data.Todo) graphql.Marshaler {309 res := obj.Done310 return graphql.MarshalBoolean(res)311}312var __DirectiveImplementors = []string{"__Directive"}313// nolint: gocyclo, errcheck, gas, goconst314func (ec *executionContext) ___Directive(sel []query.Selection, obj *introspection.Directive) graphql.Marshaler {315 fields := graphql.CollectFields(ec.doc, sel, __DirectiveImplementors, ec.variables)316 out := graphql.NewOrderedMap(len(fields))317 for i, field := range fields {318 out.Keys[i] = field.Alias319 switch field.Name {320 case "__typename":321 out.Values[i] = graphql.MarshalString("__Directive")322 case "name":323 out.Values[i] = ec.___Directive_name(field, obj)324 case "description":325 out.Values[i] = ec.___Directive_description(field, obj)326 case "locations":327 out.Values[i] = ec.___Directive_locations(field, obj)328 case "args":329 out.Values[i] = ec.___Directive_args(field, obj)330 default:331 panic("unknown field " + strconv.Quote(field.Name))332 }333 }334 return out335}336func (ec *executionContext) ___Directive_name(field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {337 res := obj.Name()338 return graphql.MarshalString(res)339}340func (ec *executionContext) ___Directive_description(field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {341 res := obj.Description()342 if res == nil {343 return graphql.Null344 }345 return graphql.MarshalString(*res)346}347func (ec *executionContext) ___Directive_locations(field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {348 res := obj.Locations()349 arr1 := graphql.Array{}350 for idx1 := range res {351 arr1 = append(arr1, func() graphql.Marshaler { return graphql.MarshalString(res[idx1]) }())352 }353 return arr1354}355func (ec *executionContext) ___Directive_args(field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {356 res := obj.Args()357 arr1 := graphql.Array{}358 for idx1 := range res {359 arr1 = append(arr1, func() graphql.Marshaler {360 if res[idx1] == nil {361 return graphql.Null362 }363 return ec.___InputValue(field.Selections, res[idx1])364 }())365 }366 return arr1367}368var __EnumValueImplementors = []string{"__EnumValue"}369// nolint: gocyclo, errcheck, gas, goconst370func (ec *executionContext) ___EnumValue(sel []query.Selection, obj *introspection.EnumValue) graphql.Marshaler {371 fields := graphql.CollectFields(ec.doc, sel, __EnumValueImplementors, ec.variables)372 out := graphql.NewOrderedMap(len(fields))373 for i, field := range fields {374 out.Keys[i] = field.Alias375 switch field.Name {376 case "__typename":377 out.Values[i] = graphql.MarshalString("__EnumValue")378 case "name":379 out.Values[i] = ec.___EnumValue_name(field, obj)380 case "description":381 out.Values[i] = ec.___EnumValue_description(field, obj)382 case "isDeprecated":383 out.Values[i] = ec.___EnumValue_isDeprecated(field, obj)384 case "deprecationReason":385 out.Values[i] = ec.___EnumValue_deprecationReason(field, obj)386 default:387 panic("unknown field " + strconv.Quote(field.Name))388 }389 }390 return out391}392func (ec *executionContext) ___EnumValue_name(field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {393 res := obj.Name()394 return graphql.MarshalString(res)395}396func (ec *executionContext) ___EnumValue_description(field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {397 res := obj.Description()398 if res == nil {399 return graphql.Null400 }401 return graphql.MarshalString(*res)402}403func (ec *executionContext) ___EnumValue_isDeprecated(field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {404 res := obj.IsDeprecated()405 return graphql.MarshalBoolean(res)406}407func (ec *executionContext) ___EnumValue_deprecationReason(field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {408 res := obj.DeprecationReason()409 if res == nil {410 return graphql.Null411 }412 return graphql.MarshalString(*res)413}414var __FieldImplementors = []string{"__Field"}415// nolint: gocyclo, errcheck, gas, goconst416func (ec *executionContext) ___Field(sel []query.Selection, obj *introspection.Field) graphql.Marshaler {417 fields := graphql.CollectFields(ec.doc, sel, __FieldImplementors, ec.variables)418 out := graphql.NewOrderedMap(len(fields))419 for i, field := range fields {420 out.Keys[i] = field.Alias421 switch field.Name {422 case "__typename":423 out.Values[i] = graphql.MarshalString("__Field")424 case "name":425 out.Values[i] = ec.___Field_name(field, obj)426 case "description":427 out.Values[i] = ec.___Field_description(field, obj)428 case "args":429 out.Values[i] = ec.___Field_args(field, obj)430 case "type":431 out.Values[i] = ec.___Field_type(field, obj)432 case "isDeprecated":433 out.Values[i] = ec.___Field_isDeprecated(field, obj)434 case "deprecationReason":435 out.Values[i] = ec.___Field_deprecationReason(field, obj)436 default:437 panic("unknown field " + strconv.Quote(field.Name))438 }439 }440 return out441}442func (ec *executionContext) ___Field_name(field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {443 res := obj.Name()444 return graphql.MarshalString(res)445}446func (ec *executionContext) ___Field_description(field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {447 res := obj.Description()448 if res == nil {449 return graphql.Null450 }451 return graphql.MarshalString(*res)452}453func (ec *executionContext) ___Field_args(field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {454 res := obj.Args()455 arr1 := graphql.Array{}456 for idx1 := range res {457 arr1 = append(arr1, func() graphql.Marshaler {458 if res[idx1] == nil {459 return graphql.Null460 }461 return ec.___InputValue(field.Selections, res[idx1])462 }())463 }464 return arr1465}466func (ec *executionContext) ___Field_type(field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {467 res := obj.Type()468 if res == nil {469 return graphql.Null470 }471 return ec.___Type(field.Selections, res)472}473func (ec *executionContext) ___Field_isDeprecated(field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {474 res := obj.IsDeprecated()475 return graphql.MarshalBoolean(res)476}477func (ec *executionContext) ___Field_deprecationReason(field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {478 res := obj.DeprecationReason()479 if res == nil {480 return graphql.Null481 }482 return graphql.MarshalString(*res)483}484var __InputValueImplementors = []string{"__InputValue"}485// nolint: gocyclo, errcheck, gas, goconst486func (ec *executionContext) ___InputValue(sel []query.Selection, obj *introspection.InputValue) graphql.Marshaler {487 fields := graphql.CollectFields(ec.doc, sel, __InputValueImplementors, ec.variables)488 out := graphql.NewOrderedMap(len(fields))489 for i, field := range fields {490 out.Keys[i] = field.Alias491 switch field.Name {492 case "__typename":493 out.Values[i] = graphql.MarshalString("__InputValue")494 case "name":495 out.Values[i] = ec.___InputValue_name(field, obj)496 case "description":497 out.Values[i] = ec.___InputValue_description(field, obj)498 case "type":499 out.Values[i] = ec.___InputValue_type(field, obj)500 case "defaultValue":501 out.Values[i] = ec.___InputValue_defaultValue(field, obj)502 default:503 panic("unknown field " + strconv.Quote(field.Name))504 }505 }506 return out507}508func (ec *executionContext) ___InputValue_name(field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {509 res := obj.Name()510 return graphql.MarshalString(res)511}512func (ec *executionContext) ___InputValue_description(field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {513 res := obj.Description()514 if res == nil {515 return graphql.Null516 }517 return graphql.MarshalString(*res)518}519func (ec *executionContext) ___InputValue_type(field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {520 res := obj.Type()521 if res == nil {522 return graphql.Null523 }524 return ec.___Type(field.Selections, res)525}526func (ec *executionContext) ___InputValue_defaultValue(field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {527 res := obj.DefaultValue()528 if res == nil {529 return graphql.Null530 }531 return graphql.MarshalString(*res)532}533var __SchemaImplementors = []string{"__Schema"}534// nolint: gocyclo, errcheck, gas, goconst535func (ec *executionContext) ___Schema(sel []query.Selection, obj *introspection.Schema) graphql.Marshaler {536 fields := graphql.CollectFields(ec.doc, sel, __SchemaImplementors, ec.variables)537 out := graphql.NewOrderedMap(len(fields))538 for i, field := range fields {539 out.Keys[i] = field.Alias540 switch field.Name {541 case "__typename":542 out.Values[i] = graphql.MarshalString("__Schema")543 case "types":544 out.Values[i] = ec.___Schema_types(field, obj)545 case "queryType":546 out.Values[i] = ec.___Schema_queryType(field, obj)547 case "mutationType":548 out.Values[i] = ec.___Schema_mutationType(field, obj)549 case "subscriptionType":550 out.Values[i] = ec.___Schema_subscriptionType(field, obj)551 case "directives":552 out.Values[i] = ec.___Schema_directives(field, obj)553 default:554 panic("unknown field " + strconv.Quote(field.Name))555 }556 }557 return out558}559func (ec *executionContext) ___Schema_types(field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {560 res := obj.Types()561 arr1 := graphql.Array{}562 for idx1 := range res {563 arr1 = append(arr1, func() graphql.Marshaler {564 if res[idx1] == nil {565 return graphql.Null566 }567 return ec.___Type(field.Selections, res[idx1])568 }())569 }570 return arr1571}572func (ec *executionContext) ___Schema_queryType(field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {573 res := obj.QueryType()574 if res == nil {575 return graphql.Null576 }577 return ec.___Type(field.Selections, res)578}579func (ec *executionContext) ___Schema_mutationType(field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {580 res := obj.MutationType()581 if res == nil {582 return graphql.Null583 }584 return ec.___Type(field.Selections, res)585}586func (ec *executionContext) ___Schema_subscriptionType(field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {587 res := obj.SubscriptionType()588 if res == nil {589 return graphql.Null590 }591 return ec.___Type(field.Selections, res)592}593func (ec *executionContext) ___Schema_directives(field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {594 res := obj.Directives()595 arr1 := graphql.Array{}596 for idx1 := range res {597 arr1 = append(arr1, func() graphql.Marshaler {598 if res[idx1] == nil {599 return graphql.Null600 }601 return ec.___Directive(field.Selections, res[idx1])602 }())603 }604 return arr1605}606var __TypeImplementors = []string{"__Type"}607// nolint: gocyclo, errcheck, gas, goconst...

Full Screen

Full Screen

generated.go

Source:generated.go Github

copy

Full Screen

...152 res := ec.introspectSchema()153 if res == nil {154 return graphql.Null155 }156 return ec.___Schema(field.Selections, res)157}158func (ec *executionContext) _Query___type(field graphql.CollectedField) graphql.Marshaler {159 var arg0 string160 if tmp, ok := field.Args["name"]; ok {161 var err error162 arg0, err = graphql.UnmarshalString(tmp)163 if err != nil {164 ec.Error(err)165 return graphql.Null166 }167 }168 res := ec.introspectType(arg0)169 if res == nil {170 return graphql.Null171 }172 return ec.___Type(field.Selections, res)173}174var rectangleImplementors = []string{"Rectangle", "Shape"}175// nolint: gocyclo, errcheck, gas, goconst176func (ec *executionContext) _Rectangle(sel []query.Selection, obj *Rectangle) graphql.Marshaler {177 fields := graphql.CollectFields(ec.doc, sel, rectangleImplementors, ec.variables)178 out := graphql.NewOrderedMap(len(fields))179 for i, field := range fields {180 out.Keys[i] = field.Alias181 switch field.Name {182 case "__typename":183 out.Values[i] = graphql.MarshalString("Rectangle")184 case "msg":185 out.Values[i] = ec._Rectangle_msg(field, obj)186 case "length":187 out.Values[i] = ec._Rectangle_length(field, obj)188 case "width":189 out.Values[i] = ec._Rectangle_width(field, obj)190 case "area":191 out.Values[i] = ec._Rectangle_area(field, obj)192 default:193 panic("unknown field " + strconv.Quote(field.Name))194 }195 }196 return out197}198func (ec *executionContext) _Rectangle_msg(field graphql.CollectedField, obj *Rectangle) graphql.Marshaler {199 res := obj.Msg200 return graphql.MarshalString(res)201}202func (ec *executionContext) _Rectangle_length(field graphql.CollectedField, obj *Rectangle) graphql.Marshaler {203 res := obj.Length204 return graphql.MarshalFloat(res)205}206func (ec *executionContext) _Rectangle_width(field graphql.CollectedField, obj *Rectangle) graphql.Marshaler {207 res := obj.Width208 return graphql.MarshalFloat(res)209}210func (ec *executionContext) _Rectangle_area(field graphql.CollectedField, obj *Rectangle) graphql.Marshaler {211 res := obj.Area()212 return graphql.MarshalFloat(res)213}214var __DirectiveImplementors = []string{"__Directive"}215// nolint: gocyclo, errcheck, gas, goconst216func (ec *executionContext) ___Directive(sel []query.Selection, obj *introspection.Directive) graphql.Marshaler {217 fields := graphql.CollectFields(ec.doc, sel, __DirectiveImplementors, ec.variables)218 out := graphql.NewOrderedMap(len(fields))219 for i, field := range fields {220 out.Keys[i] = field.Alias221 switch field.Name {222 case "__typename":223 out.Values[i] = graphql.MarshalString("__Directive")224 case "name":225 out.Values[i] = ec.___Directive_name(field, obj)226 case "description":227 out.Values[i] = ec.___Directive_description(field, obj)228 case "locations":229 out.Values[i] = ec.___Directive_locations(field, obj)230 case "args":231 out.Values[i] = ec.___Directive_args(field, obj)232 default:233 panic("unknown field " + strconv.Quote(field.Name))234 }235 }236 return out237}238func (ec *executionContext) ___Directive_name(field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {239 res := obj.Name()240 return graphql.MarshalString(res)241}242func (ec *executionContext) ___Directive_description(field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {243 res := obj.Description()244 if res == nil {245 return graphql.Null246 }247 return graphql.MarshalString(*res)248}249func (ec *executionContext) ___Directive_locations(field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {250 res := obj.Locations()251 arr1 := graphql.Array{}252 for idx1 := range res {253 arr1 = append(arr1, func() graphql.Marshaler { return graphql.MarshalString(res[idx1]) }())254 }255 return arr1256}257func (ec *executionContext) ___Directive_args(field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {258 res := obj.Args()259 arr1 := graphql.Array{}260 for idx1 := range res {261 arr1 = append(arr1, func() graphql.Marshaler {262 if res[idx1] == nil {263 return graphql.Null264 }265 return ec.___InputValue(field.Selections, res[idx1])266 }())267 }268 return arr1269}270var __EnumValueImplementors = []string{"__EnumValue"}271// nolint: gocyclo, errcheck, gas, goconst272func (ec *executionContext) ___EnumValue(sel []query.Selection, obj *introspection.EnumValue) graphql.Marshaler {273 fields := graphql.CollectFields(ec.doc, sel, __EnumValueImplementors, ec.variables)274 out := graphql.NewOrderedMap(len(fields))275 for i, field := range fields {276 out.Keys[i] = field.Alias277 switch field.Name {278 case "__typename":279 out.Values[i] = graphql.MarshalString("__EnumValue")280 case "name":281 out.Values[i] = ec.___EnumValue_name(field, obj)282 case "description":283 out.Values[i] = ec.___EnumValue_description(field, obj)284 case "isDeprecated":285 out.Values[i] = ec.___EnumValue_isDeprecated(field, obj)286 case "deprecationReason":287 out.Values[i] = ec.___EnumValue_deprecationReason(field, obj)288 default:289 panic("unknown field " + strconv.Quote(field.Name))290 }291 }292 return out293}294func (ec *executionContext) ___EnumValue_name(field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {295 res := obj.Name()296 return graphql.MarshalString(res)297}298func (ec *executionContext) ___EnumValue_description(field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {299 res := obj.Description()300 if res == nil {301 return graphql.Null302 }303 return graphql.MarshalString(*res)304}305func (ec *executionContext) ___EnumValue_isDeprecated(field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {306 res := obj.IsDeprecated()307 return graphql.MarshalBoolean(res)308}309func (ec *executionContext) ___EnumValue_deprecationReason(field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {310 res := obj.DeprecationReason()311 if res == nil {312 return graphql.Null313 }314 return graphql.MarshalString(*res)315}316var __FieldImplementors = []string{"__Field"}317// nolint: gocyclo, errcheck, gas, goconst318func (ec *executionContext) ___Field(sel []query.Selection, obj *introspection.Field) graphql.Marshaler {319 fields := graphql.CollectFields(ec.doc, sel, __FieldImplementors, ec.variables)320 out := graphql.NewOrderedMap(len(fields))321 for i, field := range fields {322 out.Keys[i] = field.Alias323 switch field.Name {324 case "__typename":325 out.Values[i] = graphql.MarshalString("__Field")326 case "name":327 out.Values[i] = ec.___Field_name(field, obj)328 case "description":329 out.Values[i] = ec.___Field_description(field, obj)330 case "args":331 out.Values[i] = ec.___Field_args(field, obj)332 case "type":333 out.Values[i] = ec.___Field_type(field, obj)334 case "isDeprecated":335 out.Values[i] = ec.___Field_isDeprecated(field, obj)336 case "deprecationReason":337 out.Values[i] = ec.___Field_deprecationReason(field, obj)338 default:339 panic("unknown field " + strconv.Quote(field.Name))340 }341 }342 return out343}344func (ec *executionContext) ___Field_name(field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {345 res := obj.Name()346 return graphql.MarshalString(res)347}348func (ec *executionContext) ___Field_description(field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {349 res := obj.Description()350 if res == nil {351 return graphql.Null352 }353 return graphql.MarshalString(*res)354}355func (ec *executionContext) ___Field_args(field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {356 res := obj.Args()357 arr1 := graphql.Array{}358 for idx1 := range res {359 arr1 = append(arr1, func() graphql.Marshaler {360 if res[idx1] == nil {361 return graphql.Null362 }363 return ec.___InputValue(field.Selections, res[idx1])364 }())365 }366 return arr1367}368func (ec *executionContext) ___Field_type(field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {369 res := obj.Type()370 if res == nil {371 return graphql.Null372 }373 return ec.___Type(field.Selections, res)374}375func (ec *executionContext) ___Field_isDeprecated(field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {376 res := obj.IsDeprecated()377 return graphql.MarshalBoolean(res)378}379func (ec *executionContext) ___Field_deprecationReason(field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {380 res := obj.DeprecationReason()381 if res == nil {382 return graphql.Null383 }384 return graphql.MarshalString(*res)385}386var __InputValueImplementors = []string{"__InputValue"}387// nolint: gocyclo, errcheck, gas, goconst388func (ec *executionContext) ___InputValue(sel []query.Selection, obj *introspection.InputValue) graphql.Marshaler {389 fields := graphql.CollectFields(ec.doc, sel, __InputValueImplementors, ec.variables)390 out := graphql.NewOrderedMap(len(fields))391 for i, field := range fields {392 out.Keys[i] = field.Alias393 switch field.Name {394 case "__typename":395 out.Values[i] = graphql.MarshalString("__InputValue")396 case "name":397 out.Values[i] = ec.___InputValue_name(field, obj)398 case "description":399 out.Values[i] = ec.___InputValue_description(field, obj)400 case "type":401 out.Values[i] = ec.___InputValue_type(field, obj)402 case "defaultValue":403 out.Values[i] = ec.___InputValue_defaultValue(field, obj)404 default:405 panic("unknown field " + strconv.Quote(field.Name))406 }407 }408 return out409}410func (ec *executionContext) ___InputValue_name(field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {411 res := obj.Name()412 return graphql.MarshalString(res)413}414func (ec *executionContext) ___InputValue_description(field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {415 res := obj.Description()416 if res == nil {417 return graphql.Null418 }419 return graphql.MarshalString(*res)420}421func (ec *executionContext) ___InputValue_type(field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {422 res := obj.Type()423 if res == nil {424 return graphql.Null425 }426 return ec.___Type(field.Selections, res)427}428func (ec *executionContext) ___InputValue_defaultValue(field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {429 res := obj.DefaultValue()430 if res == nil {431 return graphql.Null432 }433 return graphql.MarshalString(*res)434}435var __SchemaImplementors = []string{"__Schema"}436// nolint: gocyclo, errcheck, gas, goconst437func (ec *executionContext) ___Schema(sel []query.Selection, obj *introspection.Schema) graphql.Marshaler {438 fields := graphql.CollectFields(ec.doc, sel, __SchemaImplementors, ec.variables)439 out := graphql.NewOrderedMap(len(fields))440 for i, field := range fields {441 out.Keys[i] = field.Alias442 switch field.Name {443 case "__typename":444 out.Values[i] = graphql.MarshalString("__Schema")445 case "types":446 out.Values[i] = ec.___Schema_types(field, obj)447 case "queryType":448 out.Values[i] = ec.___Schema_queryType(field, obj)449 case "mutationType":450 out.Values[i] = ec.___Schema_mutationType(field, obj)451 case "subscriptionType":452 out.Values[i] = ec.___Schema_subscriptionType(field, obj)453 case "directives":454 out.Values[i] = ec.___Schema_directives(field, obj)455 default:456 panic("unknown field " + strconv.Quote(field.Name))457 }458 }459 return out460}461func (ec *executionContext) ___Schema_types(field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {462 res := obj.Types()463 arr1 := graphql.Array{}464 for idx1 := range res {465 arr1 = append(arr1, func() graphql.Marshaler {466 if res[idx1] == nil {467 return graphql.Null468 }469 return ec.___Type(field.Selections, res[idx1])470 }())471 }472 return arr1473}474func (ec *executionContext) ___Schema_queryType(field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {475 res := obj.QueryType()476 if res == nil {477 return graphql.Null478 }479 return ec.___Type(field.Selections, res)480}481func (ec *executionContext) ___Schema_mutationType(field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {482 res := obj.MutationType()483 if res == nil {484 return graphql.Null485 }486 return ec.___Type(field.Selections, res)487}488func (ec *executionContext) ___Schema_subscriptionType(field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {489 res := obj.SubscriptionType()490 if res == nil {491 return graphql.Null492 }493 return ec.___Type(field.Selections, res)494}495func (ec *executionContext) ___Schema_directives(field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {496 res := obj.Directives()497 arr1 := graphql.Array{}498 for idx1 := range res {499 arr1 = append(arr1, func() graphql.Marshaler {500 if res[idx1] == nil {501 return graphql.Null502 }503 return ec.___Directive(field.Selections, res[idx1])504 }())505 }506 return arr1507}508var __TypeImplementors = []string{"__Type"}509// nolint: gocyclo, errcheck, gas, goconst...

Full Screen

Full Screen

___Schema

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 schema := graphql.MustParseSchema(Schema, &Resolver{})4 http.Handle("/query", handler.GraphQL(NewExecutableSchema(Config{Resolvers: &Resolver{}})))5 http.Handle("/", playground.Handler("GraphQL playground", "/query"))6 log.Fatal(http.ListenAndServe(":8080", nil))7}8type Resolver struct{}9func (r *Resolver) Query() QueryResolver {10 return &queryResolver{r}11}12type queryResolver struct{ *Resolver }13func (r *queryResolver) Hello(ctx context.Context) (string, error) {14}15func (r *queryResolver) MyQuery(ctx context.Context) (string, error) {16}17func (r *queryResolver) Introspection(ctx context.Context) (introspection.Introspection, error) {18 return introspection.Introspection{}, nil19}20func (r *Resolver) Query() generated.QueryResolver {21 return &queryResolver{r}22}23type queryResolver struct{ *Resolver }24func (r *queryResolver) Hello(ctx context.Context) (string, error) {25}26func (r *queryResolver) MyQuery(ctx context.Context) (string, error) {27}28func (r *queryResolver) Introspection(ctx context.Context) (introspection.Introspection, error) {29 return introspection.Introspection{}, nil30}31import (32func main() {33 schema := graphql.MustParseSchema(Schema, &Resolver{})34 http.Handle("/query", handler.GraphQL(NewExecutableSchema(Config{Resolvers: &Resolver{}})))

Full Screen

Full Screen

___Schema

Using AI Code Generation

copy

Full Screen

1func (r *Root) ___Schema() *schema.Schema {2 return &schema.Schema{3 Types: []*schema.Type{4 {5 Fields: []*schema.Field{6 {7 Type: &schema.Type{8 Fields: []*schema.Field{9 {10 Type: &schema.Type{11 Fields: []*schema.Field{12 {13 Type: &schema.Type{14 },15 },16 },17 },18 },19 },20 },21 },22 },23 },24 },25 }26}27type Foo struct {28}29type Bar struct {30}31type Baz struct {32}33func (r *Foo) ___Schema() *schema.Schema {34 return &schema.Schema{35 Types: []*schema.Type{36 {37 Fields: []*schema.Field{38 {39 Type: &schema.Type{40 Fields: []*schema.Field{41 {42 Type: &schema.Type{43 },44 },45 },46 },47 },48 },49 },50 },51 }52}

Full Screen

Full Screen

___Schema

Using AI Code Generation

copy

Full Screen

1func main() {2 schema := new(___Schema)3 schema.___Schema()4}5func main() {6 schema := new(___Schema)7 schema.___Schema()8}9func main() {10 schema := new(___Schema)11 schema.___Schema()12}13func main() {14 schema := new(___Schema)15 schema.___Schema()16}17func main() {18 schema := new(___Schema)19 schema.___Schema()20}21func main() {22 schema := new(___Schema)23 schema.___Schema()24}25func main() {26 schema := new(___Schema)27 schema.___Schema()28}29func main() {30 schema := new(___Schema)31 schema.___Schema()32}33func main() {34 schema := new(___Schema)35 schema.___Schema()36}37func main() {38 schema := new(___Schema)

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Keploy automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful