How to use unmarshalNString2string method of generated Package

Best Keploy code snippet using generated.unmarshalNString2string

generated.go

Source:generated.go Github

copy

Full Screen

...235 args := map[string]interface{}{}236 var arg0 string237 if tmp, ok := rawArgs["username"]; ok {238 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username"))239 arg0, err = ec.unmarshalNString2string(ctx, tmp)240 if err != nil {241 return nil, err242 }243 }244 args["username"] = arg0245 return args, nil246}247func (ec *executionContext) field_Mutation_post_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {248 var err error249 args := map[string]interface{}{}250 var arg0 string251 if tmp, ok := rawArgs["text"]; ok {252 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text"))253 arg0, err = ec.unmarshalNString2string(ctx, tmp)254 if err != nil {255 return nil, err256 }257 }258 args["text"] = arg0259 var arg1 string260 if tmp, ok := rawArgs["username"]; ok {261 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username"))262 arg1, err = ec.unmarshalNString2string(ctx, tmp)263 if err != nil {264 return nil, err265 }266 }267 args["username"] = arg1268 var arg2 string269 if tmp, ok := rawArgs["roomName"]; ok {270 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roomName"))271 arg2, err = ec.unmarshalNString2string(ctx, tmp)272 if err != nil {273 return nil, err274 }275 }276 args["roomName"] = arg2277 return args, nil278}279func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {280 var err error281 args := map[string]interface{}{}282 var arg0 string283 if tmp, ok := rawArgs["name"]; ok {284 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name"))285 arg0, err = ec.unmarshalNString2string(ctx, tmp)286 if err != nil {287 return nil, err288 }289 }290 args["name"] = arg0291 return args, nil292}293func (ec *executionContext) field_Query_room_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {294 var err error295 args := map[string]interface{}{}296 var arg0 string297 if tmp, ok := rawArgs["name"]; ok {298 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name"))299 arg0, err = ec.unmarshalNString2string(ctx, tmp)300 if err != nil {301 return nil, err302 }303 }304 args["name"] = arg0305 return args, nil306}307func (ec *executionContext) field_Subscription_messageAdded_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {308 var err error309 args := map[string]interface{}{}310 var arg0 string311 if tmp, ok := rawArgs["roomName"]; ok {312 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roomName"))313 arg0, err = ec.unmarshalNString2string(ctx, tmp)314 if err != nil {315 return nil, err316 }317 }318 args["roomName"] = arg0319 return args, nil320}321func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {322 var err error323 args := map[string]interface{}{}324 var arg0 bool325 if tmp, ok := rawArgs["includeDeprecated"]; ok {326 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated"))327 arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp)328 if err != nil {329 return nil, err330 }331 }332 args["includeDeprecated"] = arg0333 return args, nil334}335func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {336 var err error337 args := map[string]interface{}{}338 var arg0 bool339 if tmp, ok := rawArgs["includeDeprecated"]; ok {340 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated"))341 arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp)342 if err != nil {343 return nil, err344 }345 }346 args["includeDeprecated"] = arg0347 return args, nil348}349// endregion ***************************** args.gotpl *****************************350// region ************************** directives.gotpl **************************351func (ec *executionContext) _subscriptionMiddleware(ctx context.Context, obj *ast.OperationDefinition, next func(ctx context.Context) (interface{}, error)) func() graphql.Marshaler {352 for _, d := range obj.Directives {353 switch d.Name {354 case "user":355 rawArgs := d.ArgumentMap(ec.Variables)356 args, err := ec.dir_user_args(ctx, rawArgs)357 if err != nil {358 ec.Error(ctx, err)359 return func() graphql.Marshaler {360 return graphql.Null361 }362 }363 n := next364 next = func(ctx context.Context) (interface{}, error) {365 if ec.directives.User == nil {366 return nil, errors.New("directive user is not implemented")367 }368 return ec.directives.User(ctx, obj, n, args["username"].(string))369 }370 }371 }372 tmp, err := next(ctx)373 if err != nil {374 ec.Error(ctx, err)375 return func() graphql.Marshaler {376 return graphql.Null377 }378 }379 if data, ok := tmp.(func() graphql.Marshaler); ok {380 return data381 }382 ec.Errorf(ctx, `unexpected type %T from directive, should be graphql.Marshaler`, tmp)383 return func() graphql.Marshaler {384 return graphql.Null385 }386}387// endregion ************************** directives.gotpl **************************388// region **************************** field.gotpl *****************************389func (ec *executionContext) _Chatroom_name(ctx context.Context, field graphql.CollectedField, obj *Chatroom) (ret graphql.Marshaler) {390 defer func() {391 if r := recover(); r != nil {392 ec.Error(ctx, ec.Recover(ctx, r))393 ret = graphql.Null394 }395 }()396 fc := &graphql.FieldContext{397 Object: "Chatroom",398 Field: field,399 Args: nil,400 IsMethod: false,401 IsResolver: false,402 }403 ctx = graphql.WithFieldContext(ctx, fc)404 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {405 ctx = rctx // use context from middleware stack in children406 return obj.Name, nil407 })408 if err != nil {409 ec.Error(ctx, err)410 return graphql.Null411 }412 if resTmp == nil {413 if !graphql.HasFieldError(ctx, fc) {414 ec.Errorf(ctx, "must not be null")415 }416 return graphql.Null417 }418 res := resTmp.(string)419 fc.Result = res420 return ec.marshalNString2string(ctx, field.Selections, res)421}422func (ec *executionContext) _Chatroom_messages(ctx context.Context, field graphql.CollectedField, obj *Chatroom) (ret graphql.Marshaler) {423 defer func() {424 if r := recover(); r != nil {425 ec.Error(ctx, ec.Recover(ctx, r))426 ret = graphql.Null427 }428 }()429 fc := &graphql.FieldContext{430 Object: "Chatroom",431 Field: field,432 Args: nil,433 IsMethod: false,434 IsResolver: false,435 }436 ctx = graphql.WithFieldContext(ctx, fc)437 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {438 ctx = rctx // use context from middleware stack in children439 return obj.Messages, nil440 })441 if err != nil {442 ec.Error(ctx, err)443 return graphql.Null444 }445 if resTmp == nil {446 if !graphql.HasFieldError(ctx, fc) {447 ec.Errorf(ctx, "must not be null")448 }449 return graphql.Null450 }451 res := resTmp.([]Message)452 fc.Result = res453 return ec.marshalNMessage2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋchatᚐMessageᚄ(ctx, field.Selections, res)454}455func (ec *executionContext) _Message_id(ctx context.Context, field graphql.CollectedField, obj *Message) (ret graphql.Marshaler) {456 defer func() {457 if r := recover(); r != nil {458 ec.Error(ctx, ec.Recover(ctx, r))459 ret = graphql.Null460 }461 }()462 fc := &graphql.FieldContext{463 Object: "Message",464 Field: field,465 Args: nil,466 IsMethod: false,467 IsResolver: false,468 }469 ctx = graphql.WithFieldContext(ctx, fc)470 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {471 ctx = rctx // use context from middleware stack in children472 return obj.ID, nil473 })474 if err != nil {475 ec.Error(ctx, err)476 return graphql.Null477 }478 if resTmp == nil {479 if !graphql.HasFieldError(ctx, fc) {480 ec.Errorf(ctx, "must not be null")481 }482 return graphql.Null483 }484 res := resTmp.(string)485 fc.Result = res486 return ec.marshalNID2string(ctx, field.Selections, res)487}488func (ec *executionContext) _Message_text(ctx context.Context, field graphql.CollectedField, obj *Message) (ret graphql.Marshaler) {489 defer func() {490 if r := recover(); r != nil {491 ec.Error(ctx, ec.Recover(ctx, r))492 ret = graphql.Null493 }494 }()495 fc := &graphql.FieldContext{496 Object: "Message",497 Field: field,498 Args: nil,499 IsMethod: false,500 IsResolver: false,501 }502 ctx = graphql.WithFieldContext(ctx, fc)503 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {504 ctx = rctx // use context from middleware stack in children505 return obj.Text, nil506 })507 if err != nil {508 ec.Error(ctx, err)509 return graphql.Null510 }511 if resTmp == nil {512 if !graphql.HasFieldError(ctx, fc) {513 ec.Errorf(ctx, "must not be null")514 }515 return graphql.Null516 }517 res := resTmp.(string)518 fc.Result = res519 return ec.marshalNString2string(ctx, field.Selections, res)520}521func (ec *executionContext) _Message_createdBy(ctx context.Context, field graphql.CollectedField, obj *Message) (ret graphql.Marshaler) {522 defer func() {523 if r := recover(); r != nil {524 ec.Error(ctx, ec.Recover(ctx, r))525 ret = graphql.Null526 }527 }()528 fc := &graphql.FieldContext{529 Object: "Message",530 Field: field,531 Args: nil,532 IsMethod: false,533 IsResolver: false,534 }535 ctx = graphql.WithFieldContext(ctx, fc)536 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {537 ctx = rctx // use context from middleware stack in children538 return obj.CreatedBy, nil539 })540 if err != nil {541 ec.Error(ctx, err)542 return graphql.Null543 }544 if resTmp == nil {545 if !graphql.HasFieldError(ctx, fc) {546 ec.Errorf(ctx, "must not be null")547 }548 return graphql.Null549 }550 res := resTmp.(string)551 fc.Result = res552 return ec.marshalNString2string(ctx, field.Selections, res)553}554func (ec *executionContext) _Message_createdAt(ctx context.Context, field graphql.CollectedField, obj *Message) (ret graphql.Marshaler) {555 defer func() {556 if r := recover(); r != nil {557 ec.Error(ctx, ec.Recover(ctx, r))558 ret = graphql.Null559 }560 }()561 fc := &graphql.FieldContext{562 Object: "Message",563 Field: field,564 Args: nil,565 IsMethod: false,566 IsResolver: false,567 }568 ctx = graphql.WithFieldContext(ctx, fc)569 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {570 ctx = rctx // use context from middleware stack in children571 return obj.CreatedAt, nil572 })573 if err != nil {574 ec.Error(ctx, err)575 return graphql.Null576 }577 if resTmp == nil {578 if !graphql.HasFieldError(ctx, fc) {579 ec.Errorf(ctx, "must not be null")580 }581 return graphql.Null582 }583 res := resTmp.(time.Time)584 fc.Result = res585 return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res)586}587func (ec *executionContext) _Mutation_post(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {588 defer func() {589 if r := recover(); r != nil {590 ec.Error(ctx, ec.Recover(ctx, r))591 ret = graphql.Null592 }593 }()594 fc := &graphql.FieldContext{595 Object: "Mutation",596 Field: field,597 Args: nil,598 IsMethod: true,599 IsResolver: true,600 }601 ctx = graphql.WithFieldContext(ctx, fc)602 rawArgs := field.ArgumentMap(ec.Variables)603 args, err := ec.field_Mutation_post_args(ctx, rawArgs)604 if err != nil {605 ec.Error(ctx, err)606 return graphql.Null607 }608 fc.Args = args609 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {610 ctx = rctx // use context from middleware stack in children611 return ec.resolvers.Mutation().Post(rctx, args["text"].(string), args["username"].(string), args["roomName"].(string))612 })613 if err != nil {614 ec.Error(ctx, err)615 return graphql.Null616 }617 if resTmp == nil {618 if !graphql.HasFieldError(ctx, fc) {619 ec.Errorf(ctx, "must not be null")620 }621 return graphql.Null622 }623 res := resTmp.(*Message)624 fc.Result = res625 return ec.marshalNMessage2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋchatᚐMessage(ctx, field.Selections, res)626}627func (ec *executionContext) _Query_room(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {628 defer func() {629 if r := recover(); r != nil {630 ec.Error(ctx, ec.Recover(ctx, r))631 ret = graphql.Null632 }633 }()634 fc := &graphql.FieldContext{635 Object: "Query",636 Field: field,637 Args: nil,638 IsMethod: true,639 IsResolver: true,640 }641 ctx = graphql.WithFieldContext(ctx, fc)642 rawArgs := field.ArgumentMap(ec.Variables)643 args, err := ec.field_Query_room_args(ctx, rawArgs)644 if err != nil {645 ec.Error(ctx, err)646 return graphql.Null647 }648 fc.Args = args649 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {650 ctx = rctx // use context from middleware stack in children651 return ec.resolvers.Query().Room(rctx, args["name"].(string))652 })653 if err != nil {654 ec.Error(ctx, err)655 return graphql.Null656 }657 if resTmp == nil {658 return graphql.Null659 }660 res := resTmp.(*Chatroom)661 fc.Result = res662 return ec.marshalOChatroom2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋchatᚐChatroom(ctx, field.Selections, res)663}664func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {665 defer func() {666 if r := recover(); r != nil {667 ec.Error(ctx, ec.Recover(ctx, r))668 ret = graphql.Null669 }670 }()671 fc := &graphql.FieldContext{672 Object: "Query",673 Field: field,674 Args: nil,675 IsMethod: true,676 IsResolver: false,677 }678 ctx = graphql.WithFieldContext(ctx, fc)679 rawArgs := field.ArgumentMap(ec.Variables)680 args, err := ec.field_Query___type_args(ctx, rawArgs)681 if err != nil {682 ec.Error(ctx, err)683 return graphql.Null684 }685 fc.Args = args686 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {687 ctx = rctx // use context from middleware stack in children688 return ec.introspectType(args["name"].(string))689 })690 if err != nil {691 ec.Error(ctx, err)692 return graphql.Null693 }694 if resTmp == nil {695 return graphql.Null696 }697 res := resTmp.(*introspection.Type)698 fc.Result = res699 return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)700}701func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {702 defer func() {703 if r := recover(); r != nil {704 ec.Error(ctx, ec.Recover(ctx, r))705 ret = graphql.Null706 }707 }()708 fc := &graphql.FieldContext{709 Object: "Query",710 Field: field,711 Args: nil,712 IsMethod: true,713 IsResolver: false,714 }715 ctx = graphql.WithFieldContext(ctx, fc)716 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {717 ctx = rctx // use context from middleware stack in children718 return ec.introspectSchema()719 })720 if err != nil {721 ec.Error(ctx, err)722 return graphql.Null723 }724 if resTmp == nil {725 return graphql.Null726 }727 res := resTmp.(*introspection.Schema)728 fc.Result = res729 return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res)730}731func (ec *executionContext) _Subscription_messageAdded(ctx context.Context, field graphql.CollectedField) (ret func() graphql.Marshaler) {732 defer func() {733 if r := recover(); r != nil {734 ec.Error(ctx, ec.Recover(ctx, r))735 ret = nil736 }737 }()738 fc := &graphql.FieldContext{739 Object: "Subscription",740 Field: field,741 Args: nil,742 IsMethod: true,743 IsResolver: true,744 }745 ctx = graphql.WithFieldContext(ctx, fc)746 rawArgs := field.ArgumentMap(ec.Variables)747 args, err := ec.field_Subscription_messageAdded_args(ctx, rawArgs)748 if err != nil {749 ec.Error(ctx, err)750 return nil751 }752 fc.Args = args753 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {754 ctx = rctx // use context from middleware stack in children755 return ec.resolvers.Subscription().MessageAdded(rctx, args["roomName"].(string))756 })757 if err != nil {758 ec.Error(ctx, err)759 return nil760 }761 if resTmp == nil {762 if !graphql.HasFieldError(ctx, fc) {763 ec.Errorf(ctx, "must not be null")764 }765 return nil766 }767 return func() graphql.Marshaler {768 res, ok := <-resTmp.(<-chan *Message)769 if !ok {770 return nil771 }772 return graphql.WriterFunc(func(w io.Writer) {773 w.Write([]byte{'{'})774 graphql.MarshalString(field.Alias).MarshalGQL(w)775 w.Write([]byte{':'})776 ec.marshalNMessage2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋchatᚐMessage(ctx, field.Selections, res).MarshalGQL(w)777 w.Write([]byte{'}'})778 })779 }780}781func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {782 defer func() {783 if r := recover(); r != nil {784 ec.Error(ctx, ec.Recover(ctx, r))785 ret = graphql.Null786 }787 }()788 fc := &graphql.FieldContext{789 Object: "__Directive",790 Field: field,791 Args: nil,792 IsMethod: false,793 IsResolver: false,794 }795 ctx = graphql.WithFieldContext(ctx, fc)796 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {797 ctx = rctx // use context from middleware stack in children798 return obj.Name, nil799 })800 if err != nil {801 ec.Error(ctx, err)802 return graphql.Null803 }804 if resTmp == nil {805 if !graphql.HasFieldError(ctx, fc) {806 ec.Errorf(ctx, "must not be null")807 }808 return graphql.Null809 }810 res := resTmp.(string)811 fc.Result = res812 return ec.marshalNString2string(ctx, field.Selections, res)813}814func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {815 defer func() {816 if r := recover(); r != nil {817 ec.Error(ctx, ec.Recover(ctx, r))818 ret = graphql.Null819 }820 }()821 fc := &graphql.FieldContext{822 Object: "__Directive",823 Field: field,824 Args: nil,825 IsMethod: false,826 IsResolver: false,827 }828 ctx = graphql.WithFieldContext(ctx, fc)829 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {830 ctx = rctx // use context from middleware stack in children831 return obj.Description, nil832 })833 if err != nil {834 ec.Error(ctx, err)835 return graphql.Null836 }837 if resTmp == nil {838 return graphql.Null839 }840 res := resTmp.(string)841 fc.Result = res842 return ec.marshalOString2string(ctx, field.Selections, res)843}844func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {845 defer func() {846 if r := recover(); r != nil {847 ec.Error(ctx, ec.Recover(ctx, r))848 ret = graphql.Null849 }850 }()851 fc := &graphql.FieldContext{852 Object: "__Directive",853 Field: field,854 Args: nil,855 IsMethod: false,856 IsResolver: false,857 }858 ctx = graphql.WithFieldContext(ctx, fc)859 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {860 ctx = rctx // use context from middleware stack in children861 return obj.Locations, nil862 })863 if err != nil {864 ec.Error(ctx, err)865 return graphql.Null866 }867 if resTmp == nil {868 if !graphql.HasFieldError(ctx, fc) {869 ec.Errorf(ctx, "must not be null")870 }871 return graphql.Null872 }873 res := resTmp.([]string)874 fc.Result = res875 return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res)876}877func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {878 defer func() {879 if r := recover(); r != nil {880 ec.Error(ctx, ec.Recover(ctx, r))881 ret = graphql.Null882 }883 }()884 fc := &graphql.FieldContext{885 Object: "__Directive",886 Field: field,887 Args: nil,888 IsMethod: false,889 IsResolver: false,890 }891 ctx = graphql.WithFieldContext(ctx, fc)892 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {893 ctx = rctx // use context from middleware stack in children894 return obj.Args, nil895 })896 if err != nil {897 ec.Error(ctx, err)898 return graphql.Null899 }900 if resTmp == nil {901 if !graphql.HasFieldError(ctx, fc) {902 ec.Errorf(ctx, "must not be null")903 }904 return graphql.Null905 }906 res := resTmp.([]introspection.InputValue)907 fc.Result = res908 return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)909}910func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {911 defer func() {912 if r := recover(); r != nil {913 ec.Error(ctx, ec.Recover(ctx, r))914 ret = graphql.Null915 }916 }()917 fc := &graphql.FieldContext{918 Object: "__Directive",919 Field: field,920 Args: nil,921 IsMethod: false,922 IsResolver: false,923 }924 ctx = graphql.WithFieldContext(ctx, fc)925 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {926 ctx = rctx // use context from middleware stack in children927 return obj.IsRepeatable, nil928 })929 if err != nil {930 ec.Error(ctx, err)931 return graphql.Null932 }933 if resTmp == nil {934 if !graphql.HasFieldError(ctx, fc) {935 ec.Errorf(ctx, "must not be null")936 }937 return graphql.Null938 }939 res := resTmp.(bool)940 fc.Result = res941 return ec.marshalNBoolean2bool(ctx, field.Selections, res)942}943func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {944 defer func() {945 if r := recover(); r != nil {946 ec.Error(ctx, ec.Recover(ctx, r))947 ret = graphql.Null948 }949 }()950 fc := &graphql.FieldContext{951 Object: "__EnumValue",952 Field: field,953 Args: nil,954 IsMethod: false,955 IsResolver: false,956 }957 ctx = graphql.WithFieldContext(ctx, fc)958 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {959 ctx = rctx // use context from middleware stack in children960 return obj.Name, nil961 })962 if err != nil {963 ec.Error(ctx, err)964 return graphql.Null965 }966 if resTmp == nil {967 if !graphql.HasFieldError(ctx, fc) {968 ec.Errorf(ctx, "must not be null")969 }970 return graphql.Null971 }972 res := resTmp.(string)973 fc.Result = res974 return ec.marshalNString2string(ctx, field.Selections, res)975}976func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {977 defer func() {978 if r := recover(); r != nil {979 ec.Error(ctx, ec.Recover(ctx, r))980 ret = graphql.Null981 }982 }()983 fc := &graphql.FieldContext{984 Object: "__EnumValue",985 Field: field,986 Args: nil,987 IsMethod: false,988 IsResolver: false,989 }990 ctx = graphql.WithFieldContext(ctx, fc)991 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {992 ctx = rctx // use context from middleware stack in children993 return obj.Description, nil994 })995 if err != nil {996 ec.Error(ctx, err)997 return graphql.Null998 }999 if resTmp == nil {1000 return graphql.Null1001 }1002 res := resTmp.(string)1003 fc.Result = res1004 return ec.marshalOString2string(ctx, field.Selections, res)1005}1006func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {1007 defer func() {1008 if r := recover(); r != nil {1009 ec.Error(ctx, ec.Recover(ctx, r))1010 ret = graphql.Null1011 }1012 }()1013 fc := &graphql.FieldContext{1014 Object: "__EnumValue",1015 Field: field,1016 Args: nil,1017 IsMethod: true,1018 IsResolver: false,1019 }1020 ctx = graphql.WithFieldContext(ctx, fc)1021 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1022 ctx = rctx // use context from middleware stack in children1023 return obj.IsDeprecated(), nil1024 })1025 if err != nil {1026 ec.Error(ctx, err)1027 return graphql.Null1028 }1029 if resTmp == nil {1030 if !graphql.HasFieldError(ctx, fc) {1031 ec.Errorf(ctx, "must not be null")1032 }1033 return graphql.Null1034 }1035 res := resTmp.(bool)1036 fc.Result = res1037 return ec.marshalNBoolean2bool(ctx, field.Selections, res)1038}1039func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {1040 defer func() {1041 if r := recover(); r != nil {1042 ec.Error(ctx, ec.Recover(ctx, r))1043 ret = graphql.Null1044 }1045 }()1046 fc := &graphql.FieldContext{1047 Object: "__EnumValue",1048 Field: field,1049 Args: nil,1050 IsMethod: true,1051 IsResolver: false,1052 }1053 ctx = graphql.WithFieldContext(ctx, fc)1054 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1055 ctx = rctx // use context from middleware stack in children1056 return obj.DeprecationReason(), nil1057 })1058 if err != nil {1059 ec.Error(ctx, err)1060 return graphql.Null1061 }1062 if resTmp == nil {1063 return graphql.Null1064 }1065 res := resTmp.(*string)1066 fc.Result = res1067 return ec.marshalOString2ᚖstring(ctx, field.Selections, res)1068}1069func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {1070 defer func() {1071 if r := recover(); r != nil {1072 ec.Error(ctx, ec.Recover(ctx, r))1073 ret = graphql.Null1074 }1075 }()1076 fc := &graphql.FieldContext{1077 Object: "__Field",1078 Field: field,1079 Args: nil,1080 IsMethod: false,1081 IsResolver: false,1082 }1083 ctx = graphql.WithFieldContext(ctx, fc)1084 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1085 ctx = rctx // use context from middleware stack in children1086 return obj.Name, nil1087 })1088 if err != nil {1089 ec.Error(ctx, err)1090 return graphql.Null1091 }1092 if resTmp == nil {1093 if !graphql.HasFieldError(ctx, fc) {1094 ec.Errorf(ctx, "must not be null")1095 }1096 return graphql.Null1097 }1098 res := resTmp.(string)1099 fc.Result = res1100 return ec.marshalNString2string(ctx, field.Selections, res)1101}1102func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {1103 defer func() {1104 if r := recover(); r != nil {1105 ec.Error(ctx, ec.Recover(ctx, r))1106 ret = graphql.Null1107 }1108 }()1109 fc := &graphql.FieldContext{1110 Object: "__Field",1111 Field: field,1112 Args: nil,1113 IsMethod: false,1114 IsResolver: false,1115 }1116 ctx = graphql.WithFieldContext(ctx, fc)1117 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1118 ctx = rctx // use context from middleware stack in children1119 return obj.Description, nil1120 })1121 if err != nil {1122 ec.Error(ctx, err)1123 return graphql.Null1124 }1125 if resTmp == nil {1126 return graphql.Null1127 }1128 res := resTmp.(string)1129 fc.Result = res1130 return ec.marshalOString2string(ctx, field.Selections, res)1131}1132func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {1133 defer func() {1134 if r := recover(); r != nil {1135 ec.Error(ctx, ec.Recover(ctx, r))1136 ret = graphql.Null1137 }1138 }()1139 fc := &graphql.FieldContext{1140 Object: "__Field",1141 Field: field,1142 Args: nil,1143 IsMethod: false,1144 IsResolver: false,1145 }1146 ctx = graphql.WithFieldContext(ctx, fc)1147 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1148 ctx = rctx // use context from middleware stack in children1149 return obj.Args, nil1150 })1151 if err != nil {1152 ec.Error(ctx, err)1153 return graphql.Null1154 }1155 if resTmp == nil {1156 if !graphql.HasFieldError(ctx, fc) {1157 ec.Errorf(ctx, "must not be null")1158 }1159 return graphql.Null1160 }1161 res := resTmp.([]introspection.InputValue)1162 fc.Result = res1163 return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)1164}1165func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {1166 defer func() {1167 if r := recover(); r != nil {1168 ec.Error(ctx, ec.Recover(ctx, r))1169 ret = graphql.Null1170 }1171 }()1172 fc := &graphql.FieldContext{1173 Object: "__Field",1174 Field: field,1175 Args: nil,1176 IsMethod: false,1177 IsResolver: false,1178 }1179 ctx = graphql.WithFieldContext(ctx, fc)1180 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1181 ctx = rctx // use context from middleware stack in children1182 return obj.Type, nil1183 })1184 if err != nil {1185 ec.Error(ctx, err)1186 return graphql.Null1187 }1188 if resTmp == nil {1189 if !graphql.HasFieldError(ctx, fc) {1190 ec.Errorf(ctx, "must not be null")1191 }1192 return graphql.Null1193 }1194 res := resTmp.(*introspection.Type)1195 fc.Result = res1196 return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)1197}1198func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {1199 defer func() {1200 if r := recover(); r != nil {1201 ec.Error(ctx, ec.Recover(ctx, r))1202 ret = graphql.Null1203 }1204 }()1205 fc := &graphql.FieldContext{1206 Object: "__Field",1207 Field: field,1208 Args: nil,1209 IsMethod: true,1210 IsResolver: false,1211 }1212 ctx = graphql.WithFieldContext(ctx, fc)1213 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1214 ctx = rctx // use context from middleware stack in children1215 return obj.IsDeprecated(), nil1216 })1217 if err != nil {1218 ec.Error(ctx, err)1219 return graphql.Null1220 }1221 if resTmp == nil {1222 if !graphql.HasFieldError(ctx, fc) {1223 ec.Errorf(ctx, "must not be null")1224 }1225 return graphql.Null1226 }1227 res := resTmp.(bool)1228 fc.Result = res1229 return ec.marshalNBoolean2bool(ctx, field.Selections, res)1230}1231func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {1232 defer func() {1233 if r := recover(); r != nil {1234 ec.Error(ctx, ec.Recover(ctx, r))1235 ret = graphql.Null1236 }1237 }()1238 fc := &graphql.FieldContext{1239 Object: "__Field",1240 Field: field,1241 Args: nil,1242 IsMethod: true,1243 IsResolver: false,1244 }1245 ctx = graphql.WithFieldContext(ctx, fc)1246 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1247 ctx = rctx // use context from middleware stack in children1248 return obj.DeprecationReason(), nil1249 })1250 if err != nil {1251 ec.Error(ctx, err)1252 return graphql.Null1253 }1254 if resTmp == nil {1255 return graphql.Null1256 }1257 res := resTmp.(*string)1258 fc.Result = res1259 return ec.marshalOString2ᚖstring(ctx, field.Selections, res)1260}1261func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {1262 defer func() {1263 if r := recover(); r != nil {1264 ec.Error(ctx, ec.Recover(ctx, r))1265 ret = graphql.Null1266 }1267 }()1268 fc := &graphql.FieldContext{1269 Object: "__InputValue",1270 Field: field,1271 Args: nil,1272 IsMethod: false,1273 IsResolver: false,1274 }1275 ctx = graphql.WithFieldContext(ctx, fc)1276 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1277 ctx = rctx // use context from middleware stack in children1278 return obj.Name, nil1279 })1280 if err != nil {1281 ec.Error(ctx, err)1282 return graphql.Null1283 }1284 if resTmp == nil {1285 if !graphql.HasFieldError(ctx, fc) {1286 ec.Errorf(ctx, "must not be null")1287 }1288 return graphql.Null1289 }1290 res := resTmp.(string)1291 fc.Result = res1292 return ec.marshalNString2string(ctx, field.Selections, res)1293}1294func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {1295 defer func() {1296 if r := recover(); r != nil {1297 ec.Error(ctx, ec.Recover(ctx, r))1298 ret = graphql.Null1299 }1300 }()1301 fc := &graphql.FieldContext{1302 Object: "__InputValue",1303 Field: field,1304 Args: nil,1305 IsMethod: false,1306 IsResolver: false,1307 }1308 ctx = graphql.WithFieldContext(ctx, fc)1309 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1310 ctx = rctx // use context from middleware stack in children1311 return obj.Description, nil1312 })1313 if err != nil {1314 ec.Error(ctx, err)1315 return graphql.Null1316 }1317 if resTmp == nil {1318 return graphql.Null1319 }1320 res := resTmp.(string)1321 fc.Result = res1322 return ec.marshalOString2string(ctx, field.Selections, res)1323}1324func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {1325 defer func() {1326 if r := recover(); r != nil {1327 ec.Error(ctx, ec.Recover(ctx, r))1328 ret = graphql.Null1329 }1330 }()1331 fc := &graphql.FieldContext{1332 Object: "__InputValue",1333 Field: field,1334 Args: nil,1335 IsMethod: false,1336 IsResolver: false,1337 }1338 ctx = graphql.WithFieldContext(ctx, fc)1339 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1340 ctx = rctx // use context from middleware stack in children1341 return obj.Type, nil1342 })1343 if err != nil {1344 ec.Error(ctx, err)1345 return graphql.Null1346 }1347 if resTmp == nil {1348 if !graphql.HasFieldError(ctx, fc) {1349 ec.Errorf(ctx, "must not be null")1350 }1351 return graphql.Null1352 }1353 res := resTmp.(*introspection.Type)1354 fc.Result = res1355 return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)1356}1357func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {1358 defer func() {1359 if r := recover(); r != nil {1360 ec.Error(ctx, ec.Recover(ctx, r))1361 ret = graphql.Null1362 }1363 }()1364 fc := &graphql.FieldContext{1365 Object: "__InputValue",1366 Field: field,1367 Args: nil,1368 IsMethod: false,1369 IsResolver: false,1370 }1371 ctx = graphql.WithFieldContext(ctx, fc)1372 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1373 ctx = rctx // use context from middleware stack in children1374 return obj.DefaultValue, nil1375 })1376 if err != nil {1377 ec.Error(ctx, err)1378 return graphql.Null1379 }1380 if resTmp == nil {1381 return graphql.Null1382 }1383 res := resTmp.(*string)1384 fc.Result = res1385 return ec.marshalOString2ᚖstring(ctx, field.Selections, res)1386}1387func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {1388 defer func() {1389 if r := recover(); r != nil {1390 ec.Error(ctx, ec.Recover(ctx, r))1391 ret = graphql.Null1392 }1393 }()1394 fc := &graphql.FieldContext{1395 Object: "__Schema",1396 Field: field,1397 Args: nil,1398 IsMethod: true,1399 IsResolver: false,1400 }1401 ctx = graphql.WithFieldContext(ctx, fc)1402 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1403 ctx = rctx // use context from middleware stack in children1404 return obj.Types(), nil1405 })1406 if err != nil {1407 ec.Error(ctx, err)1408 return graphql.Null1409 }1410 if resTmp == nil {1411 if !graphql.HasFieldError(ctx, fc) {1412 ec.Errorf(ctx, "must not be null")1413 }1414 return graphql.Null1415 }1416 res := resTmp.([]introspection.Type)1417 fc.Result = res1418 return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res)1419}1420func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {1421 defer func() {1422 if r := recover(); r != nil {1423 ec.Error(ctx, ec.Recover(ctx, r))1424 ret = graphql.Null1425 }1426 }()1427 fc := &graphql.FieldContext{1428 Object: "__Schema",1429 Field: field,1430 Args: nil,1431 IsMethod: true,1432 IsResolver: false,1433 }1434 ctx = graphql.WithFieldContext(ctx, fc)1435 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1436 ctx = rctx // use context from middleware stack in children1437 return obj.QueryType(), nil1438 })1439 if err != nil {1440 ec.Error(ctx, err)1441 return graphql.Null1442 }1443 if resTmp == nil {1444 if !graphql.HasFieldError(ctx, fc) {1445 ec.Errorf(ctx, "must not be null")1446 }1447 return graphql.Null1448 }1449 res := resTmp.(*introspection.Type)1450 fc.Result = res1451 return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)1452}1453func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {1454 defer func() {1455 if r := recover(); r != nil {1456 ec.Error(ctx, ec.Recover(ctx, r))1457 ret = graphql.Null1458 }1459 }()1460 fc := &graphql.FieldContext{1461 Object: "__Schema",1462 Field: field,1463 Args: nil,1464 IsMethod: true,1465 IsResolver: false,1466 }1467 ctx = graphql.WithFieldContext(ctx, fc)1468 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1469 ctx = rctx // use context from middleware stack in children1470 return obj.MutationType(), nil1471 })1472 if err != nil {1473 ec.Error(ctx, err)1474 return graphql.Null1475 }1476 if resTmp == nil {1477 return graphql.Null1478 }1479 res := resTmp.(*introspection.Type)1480 fc.Result = res1481 return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)1482}1483func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {1484 defer func() {1485 if r := recover(); r != nil {1486 ec.Error(ctx, ec.Recover(ctx, r))1487 ret = graphql.Null1488 }1489 }()1490 fc := &graphql.FieldContext{1491 Object: "__Schema",1492 Field: field,1493 Args: nil,1494 IsMethod: true,1495 IsResolver: false,1496 }1497 ctx = graphql.WithFieldContext(ctx, fc)1498 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1499 ctx = rctx // use context from middleware stack in children1500 return obj.SubscriptionType(), nil1501 })1502 if err != nil {1503 ec.Error(ctx, err)1504 return graphql.Null1505 }1506 if resTmp == nil {1507 return graphql.Null1508 }1509 res := resTmp.(*introspection.Type)1510 fc.Result = res1511 return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)1512}1513func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {1514 defer func() {1515 if r := recover(); r != nil {1516 ec.Error(ctx, ec.Recover(ctx, r))1517 ret = graphql.Null1518 }1519 }()1520 fc := &graphql.FieldContext{1521 Object: "__Schema",1522 Field: field,1523 Args: nil,1524 IsMethod: true,1525 IsResolver: false,1526 }1527 ctx = graphql.WithFieldContext(ctx, fc)1528 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1529 ctx = rctx // use context from middleware stack in children1530 return obj.Directives(), nil1531 })1532 if err != nil {1533 ec.Error(ctx, err)1534 return graphql.Null1535 }1536 if resTmp == nil {1537 if !graphql.HasFieldError(ctx, fc) {1538 ec.Errorf(ctx, "must not be null")1539 }1540 return graphql.Null1541 }1542 res := resTmp.([]introspection.Directive)1543 fc.Result = res1544 return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res)1545}1546func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {1547 defer func() {1548 if r := recover(); r != nil {1549 ec.Error(ctx, ec.Recover(ctx, r))1550 ret = graphql.Null1551 }1552 }()1553 fc := &graphql.FieldContext{1554 Object: "__Type",1555 Field: field,1556 Args: nil,1557 IsMethod: true,1558 IsResolver: false,1559 }1560 ctx = graphql.WithFieldContext(ctx, fc)1561 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1562 ctx = rctx // use context from middleware stack in children1563 return obj.Kind(), nil1564 })1565 if err != nil {1566 ec.Error(ctx, err)1567 return graphql.Null1568 }1569 if resTmp == nil {1570 if !graphql.HasFieldError(ctx, fc) {1571 ec.Errorf(ctx, "must not be null")1572 }1573 return graphql.Null1574 }1575 res := resTmp.(string)1576 fc.Result = res1577 return ec.marshalN__TypeKind2string(ctx, field.Selections, res)1578}1579func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {1580 defer func() {1581 if r := recover(); r != nil {1582 ec.Error(ctx, ec.Recover(ctx, r))1583 ret = graphql.Null1584 }1585 }()1586 fc := &graphql.FieldContext{1587 Object: "__Type",1588 Field: field,1589 Args: nil,1590 IsMethod: true,1591 IsResolver: false,1592 }1593 ctx = graphql.WithFieldContext(ctx, fc)1594 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1595 ctx = rctx // use context from middleware stack in children1596 return obj.Name(), nil1597 })1598 if err != nil {1599 ec.Error(ctx, err)1600 return graphql.Null1601 }1602 if resTmp == nil {1603 return graphql.Null1604 }1605 res := resTmp.(*string)1606 fc.Result = res1607 return ec.marshalOString2ᚖstring(ctx, field.Selections, res)1608}1609func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {1610 defer func() {1611 if r := recover(); r != nil {1612 ec.Error(ctx, ec.Recover(ctx, r))1613 ret = graphql.Null1614 }1615 }()1616 fc := &graphql.FieldContext{1617 Object: "__Type",1618 Field: field,1619 Args: nil,1620 IsMethod: true,1621 IsResolver: false,1622 }1623 ctx = graphql.WithFieldContext(ctx, fc)1624 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1625 ctx = rctx // use context from middleware stack in children1626 return obj.Description(), nil1627 })1628 if err != nil {1629 ec.Error(ctx, err)1630 return graphql.Null1631 }1632 if resTmp == nil {1633 return graphql.Null1634 }1635 res := resTmp.(string)1636 fc.Result = res1637 return ec.marshalOString2string(ctx, field.Selections, res)1638}1639func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {1640 defer func() {1641 if r := recover(); r != nil {1642 ec.Error(ctx, ec.Recover(ctx, r))1643 ret = graphql.Null1644 }1645 }()1646 fc := &graphql.FieldContext{1647 Object: "__Type",1648 Field: field,1649 Args: nil,1650 IsMethod: true,1651 IsResolver: false,1652 }1653 ctx = graphql.WithFieldContext(ctx, fc)1654 rawArgs := field.ArgumentMap(ec.Variables)1655 args, err := ec.field___Type_fields_args(ctx, rawArgs)1656 if err != nil {1657 ec.Error(ctx, err)1658 return graphql.Null1659 }1660 fc.Args = args1661 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1662 ctx = rctx // use context from middleware stack in children1663 return obj.Fields(args["includeDeprecated"].(bool)), nil1664 })1665 if err != nil {1666 ec.Error(ctx, err)1667 return graphql.Null1668 }1669 if resTmp == nil {1670 return graphql.Null1671 }1672 res := resTmp.([]introspection.Field)1673 fc.Result = res1674 return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res)1675}1676func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {1677 defer func() {1678 if r := recover(); r != nil {1679 ec.Error(ctx, ec.Recover(ctx, r))1680 ret = graphql.Null1681 }1682 }()1683 fc := &graphql.FieldContext{1684 Object: "__Type",1685 Field: field,1686 Args: nil,1687 IsMethod: true,1688 IsResolver: false,1689 }1690 ctx = graphql.WithFieldContext(ctx, fc)1691 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1692 ctx = rctx // use context from middleware stack in children1693 return obj.Interfaces(), nil1694 })1695 if err != nil {1696 ec.Error(ctx, err)1697 return graphql.Null1698 }1699 if resTmp == nil {1700 return graphql.Null1701 }1702 res := resTmp.([]introspection.Type)1703 fc.Result = res1704 return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res)1705}1706func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {1707 defer func() {1708 if r := recover(); r != nil {1709 ec.Error(ctx, ec.Recover(ctx, r))1710 ret = graphql.Null1711 }1712 }()1713 fc := &graphql.FieldContext{1714 Object: "__Type",1715 Field: field,1716 Args: nil,1717 IsMethod: true,1718 IsResolver: false,1719 }1720 ctx = graphql.WithFieldContext(ctx, fc)1721 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1722 ctx = rctx // use context from middleware stack in children1723 return obj.PossibleTypes(), nil1724 })1725 if err != nil {1726 ec.Error(ctx, err)1727 return graphql.Null1728 }1729 if resTmp == nil {1730 return graphql.Null1731 }1732 res := resTmp.([]introspection.Type)1733 fc.Result = res1734 return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res)1735}1736func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {1737 defer func() {1738 if r := recover(); r != nil {1739 ec.Error(ctx, ec.Recover(ctx, r))1740 ret = graphql.Null1741 }1742 }()1743 fc := &graphql.FieldContext{1744 Object: "__Type",1745 Field: field,1746 Args: nil,1747 IsMethod: true,1748 IsResolver: false,1749 }1750 ctx = graphql.WithFieldContext(ctx, fc)1751 rawArgs := field.ArgumentMap(ec.Variables)1752 args, err := ec.field___Type_enumValues_args(ctx, rawArgs)1753 if err != nil {1754 ec.Error(ctx, err)1755 return graphql.Null1756 }1757 fc.Args = args1758 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1759 ctx = rctx // use context from middleware stack in children1760 return obj.EnumValues(args["includeDeprecated"].(bool)), nil1761 })1762 if err != nil {1763 ec.Error(ctx, err)1764 return graphql.Null1765 }1766 if resTmp == nil {1767 return graphql.Null1768 }1769 res := resTmp.([]introspection.EnumValue)1770 fc.Result = res1771 return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res)1772}1773func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {1774 defer func() {1775 if r := recover(); r != nil {1776 ec.Error(ctx, ec.Recover(ctx, r))1777 ret = graphql.Null1778 }1779 }()1780 fc := &graphql.FieldContext{1781 Object: "__Type",1782 Field: field,1783 Args: nil,1784 IsMethod: true,1785 IsResolver: false,1786 }1787 ctx = graphql.WithFieldContext(ctx, fc)1788 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1789 ctx = rctx // use context from middleware stack in children1790 return obj.InputFields(), nil1791 })1792 if err != nil {1793 ec.Error(ctx, err)1794 return graphql.Null1795 }1796 if resTmp == nil {1797 return graphql.Null1798 }1799 res := resTmp.([]introspection.InputValue)1800 fc.Result = res1801 return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)1802}1803func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {1804 defer func() {1805 if r := recover(); r != nil {1806 ec.Error(ctx, ec.Recover(ctx, r))1807 ret = graphql.Null1808 }1809 }()1810 fc := &graphql.FieldContext{1811 Object: "__Type",1812 Field: field,1813 Args: nil,1814 IsMethod: true,1815 IsResolver: false,1816 }1817 ctx = graphql.WithFieldContext(ctx, fc)1818 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1819 ctx = rctx // use context from middleware stack in children1820 return obj.OfType(), nil1821 })1822 if err != nil {1823 ec.Error(ctx, err)1824 return graphql.Null1825 }1826 if resTmp == nil {1827 return graphql.Null1828 }1829 res := resTmp.(*introspection.Type)1830 fc.Result = res1831 return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)1832}1833// endregion **************************** field.gotpl *****************************1834// region **************************** input.gotpl *****************************1835// endregion **************************** input.gotpl *****************************1836// region ************************** interface.gotpl ***************************1837// endregion ************************** interface.gotpl ***************************1838// region **************************** object.gotpl ****************************1839var chatroomImplementors = []string{"Chatroom"}1840func (ec *executionContext) _Chatroom(ctx context.Context, sel ast.SelectionSet, obj *Chatroom) graphql.Marshaler {1841 fields := graphql.CollectFields(ec.OperationContext, sel, chatroomImplementors)1842 out := graphql.NewFieldSet(fields)1843 var invalids uint321844 for i, field := range fields {1845 switch field.Name {1846 case "__typename":1847 out.Values[i] = graphql.MarshalString("Chatroom")1848 case "name":1849 out.Values[i] = ec._Chatroom_name(ctx, field, obj)1850 if out.Values[i] == graphql.Null {1851 invalids++1852 }1853 case "messages":1854 out.Values[i] = ec._Chatroom_messages(ctx, field, obj)1855 if out.Values[i] == graphql.Null {1856 invalids++1857 }1858 default:1859 panic("unknown field " + strconv.Quote(field.Name))1860 }1861 }1862 out.Dispatch()1863 if invalids > 0 {1864 return graphql.Null1865 }1866 return out1867}1868var messageImplementors = []string{"Message"}1869func (ec *executionContext) _Message(ctx context.Context, sel ast.SelectionSet, obj *Message) graphql.Marshaler {1870 fields := graphql.CollectFields(ec.OperationContext, sel, messageImplementors)1871 out := graphql.NewFieldSet(fields)1872 var invalids uint321873 for i, field := range fields {1874 switch field.Name {1875 case "__typename":1876 out.Values[i] = graphql.MarshalString("Message")1877 case "id":1878 out.Values[i] = ec._Message_id(ctx, field, obj)1879 if out.Values[i] == graphql.Null {1880 invalids++1881 }1882 case "text":1883 out.Values[i] = ec._Message_text(ctx, field, obj)1884 if out.Values[i] == graphql.Null {1885 invalids++1886 }1887 case "createdBy":1888 out.Values[i] = ec._Message_createdBy(ctx, field, obj)1889 if out.Values[i] == graphql.Null {1890 invalids++1891 }1892 case "createdAt":1893 out.Values[i] = ec._Message_createdAt(ctx, field, obj)1894 if out.Values[i] == graphql.Null {1895 invalids++1896 }1897 default:1898 panic("unknown field " + strconv.Quote(field.Name))1899 }1900 }1901 out.Dispatch()1902 if invalids > 0 {1903 return graphql.Null1904 }1905 return out1906}1907var mutationImplementors = []string{"Mutation"}1908func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {1909 fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors)1910 ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{1911 Object: "Mutation",1912 })1913 out := graphql.NewFieldSet(fields)1914 var invalids uint321915 for i, field := range fields {1916 switch field.Name {1917 case "__typename":1918 out.Values[i] = graphql.MarshalString("Mutation")1919 case "post":1920 out.Values[i] = ec._Mutation_post(ctx, field)1921 if out.Values[i] == graphql.Null {1922 invalids++1923 }1924 default:1925 panic("unknown field " + strconv.Quote(field.Name))1926 }1927 }1928 out.Dispatch()1929 if invalids > 0 {1930 return graphql.Null1931 }1932 return out1933}1934var queryImplementors = []string{"Query"}1935func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {1936 fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors)1937 ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{1938 Object: "Query",1939 })1940 out := graphql.NewFieldSet(fields)1941 var invalids uint321942 for i, field := range fields {1943 switch field.Name {1944 case "__typename":1945 out.Values[i] = graphql.MarshalString("Query")1946 case "room":1947 field := field1948 out.Concurrently(i, func() (res graphql.Marshaler) {1949 defer func() {1950 if r := recover(); r != nil {1951 ec.Error(ctx, ec.Recover(ctx, r))1952 }1953 }()1954 res = ec._Query_room(ctx, field)1955 return res1956 })1957 case "__type":1958 out.Values[i] = ec._Query___type(ctx, field)1959 case "__schema":1960 out.Values[i] = ec._Query___schema(ctx, field)1961 default:1962 panic("unknown field " + strconv.Quote(field.Name))1963 }1964 }1965 out.Dispatch()1966 if invalids > 0 {1967 return graphql.Null1968 }1969 return out1970}1971var subscriptionImplementors = []string{"Subscription"}1972func (ec *executionContext) _Subscription(ctx context.Context, sel ast.SelectionSet) func() graphql.Marshaler {1973 fields := graphql.CollectFields(ec.OperationContext, sel, subscriptionImplementors)1974 ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{1975 Object: "Subscription",1976 })1977 if len(fields) != 1 {1978 ec.Errorf(ctx, "must subscribe to exactly one stream")1979 return nil1980 }1981 switch fields[0].Name {1982 case "messageAdded":1983 return ec._Subscription_messageAdded(ctx, fields[0])1984 default:1985 panic("unknown field " + strconv.Quote(fields[0].Name))1986 }1987}1988var __DirectiveImplementors = []string{"__Directive"}1989func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler {1990 fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors)1991 out := graphql.NewFieldSet(fields)1992 var invalids uint321993 for i, field := range fields {1994 switch field.Name {1995 case "__typename":1996 out.Values[i] = graphql.MarshalString("__Directive")1997 case "name":1998 out.Values[i] = ec.___Directive_name(ctx, field, obj)1999 if out.Values[i] == graphql.Null {2000 invalids++2001 }2002 case "description":2003 out.Values[i] = ec.___Directive_description(ctx, field, obj)2004 case "locations":2005 out.Values[i] = ec.___Directive_locations(ctx, field, obj)2006 if out.Values[i] == graphql.Null {2007 invalids++2008 }2009 case "args":2010 out.Values[i] = ec.___Directive_args(ctx, field, obj)2011 if out.Values[i] == graphql.Null {2012 invalids++2013 }2014 case "isRepeatable":2015 out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj)2016 if out.Values[i] == graphql.Null {2017 invalids++2018 }2019 default:2020 panic("unknown field " + strconv.Quote(field.Name))2021 }2022 }2023 out.Dispatch()2024 if invalids > 0 {2025 return graphql.Null2026 }2027 return out2028}2029var __EnumValueImplementors = []string{"__EnumValue"}2030func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler {2031 fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors)2032 out := graphql.NewFieldSet(fields)2033 var invalids uint322034 for i, field := range fields {2035 switch field.Name {2036 case "__typename":2037 out.Values[i] = graphql.MarshalString("__EnumValue")2038 case "name":2039 out.Values[i] = ec.___EnumValue_name(ctx, field, obj)2040 if out.Values[i] == graphql.Null {2041 invalids++2042 }2043 case "description":2044 out.Values[i] = ec.___EnumValue_description(ctx, field, obj)2045 case "isDeprecated":2046 out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj)2047 if out.Values[i] == graphql.Null {2048 invalids++2049 }2050 case "deprecationReason":2051 out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj)2052 default:2053 panic("unknown field " + strconv.Quote(field.Name))2054 }2055 }2056 out.Dispatch()2057 if invalids > 0 {2058 return graphql.Null2059 }2060 return out2061}2062var __FieldImplementors = []string{"__Field"}2063func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler {2064 fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors)2065 out := graphql.NewFieldSet(fields)2066 var invalids uint322067 for i, field := range fields {2068 switch field.Name {2069 case "__typename":2070 out.Values[i] = graphql.MarshalString("__Field")2071 case "name":2072 out.Values[i] = ec.___Field_name(ctx, field, obj)2073 if out.Values[i] == graphql.Null {2074 invalids++2075 }2076 case "description":2077 out.Values[i] = ec.___Field_description(ctx, field, obj)2078 case "args":2079 out.Values[i] = ec.___Field_args(ctx, field, obj)2080 if out.Values[i] == graphql.Null {2081 invalids++2082 }2083 case "type":2084 out.Values[i] = ec.___Field_type(ctx, field, obj)2085 if out.Values[i] == graphql.Null {2086 invalids++2087 }2088 case "isDeprecated":2089 out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj)2090 if out.Values[i] == graphql.Null {2091 invalids++2092 }2093 case "deprecationReason":2094 out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj)2095 default:2096 panic("unknown field " + strconv.Quote(field.Name))2097 }2098 }2099 out.Dispatch()2100 if invalids > 0 {2101 return graphql.Null2102 }2103 return out2104}2105var __InputValueImplementors = []string{"__InputValue"}2106func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler {2107 fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors)2108 out := graphql.NewFieldSet(fields)2109 var invalids uint322110 for i, field := range fields {2111 switch field.Name {2112 case "__typename":2113 out.Values[i] = graphql.MarshalString("__InputValue")2114 case "name":2115 out.Values[i] = ec.___InputValue_name(ctx, field, obj)2116 if out.Values[i] == graphql.Null {2117 invalids++2118 }2119 case "description":2120 out.Values[i] = ec.___InputValue_description(ctx, field, obj)2121 case "type":2122 out.Values[i] = ec.___InputValue_type(ctx, field, obj)2123 if out.Values[i] == graphql.Null {2124 invalids++2125 }2126 case "defaultValue":2127 out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj)2128 default:2129 panic("unknown field " + strconv.Quote(field.Name))2130 }2131 }2132 out.Dispatch()2133 if invalids > 0 {2134 return graphql.Null2135 }2136 return out2137}2138var __SchemaImplementors = []string{"__Schema"}2139func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler {2140 fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors)2141 out := graphql.NewFieldSet(fields)2142 var invalids uint322143 for i, field := range fields {2144 switch field.Name {2145 case "__typename":2146 out.Values[i] = graphql.MarshalString("__Schema")2147 case "types":2148 out.Values[i] = ec.___Schema_types(ctx, field, obj)2149 if out.Values[i] == graphql.Null {2150 invalids++2151 }2152 case "queryType":2153 out.Values[i] = ec.___Schema_queryType(ctx, field, obj)2154 if out.Values[i] == graphql.Null {2155 invalids++2156 }2157 case "mutationType":2158 out.Values[i] = ec.___Schema_mutationType(ctx, field, obj)2159 case "subscriptionType":2160 out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj)2161 case "directives":2162 out.Values[i] = ec.___Schema_directives(ctx, field, obj)2163 if out.Values[i] == graphql.Null {2164 invalids++2165 }2166 default:2167 panic("unknown field " + strconv.Quote(field.Name))2168 }2169 }2170 out.Dispatch()2171 if invalids > 0 {2172 return graphql.Null2173 }2174 return out2175}2176var __TypeImplementors = []string{"__Type"}2177func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler {2178 fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors)2179 out := graphql.NewFieldSet(fields)2180 var invalids uint322181 for i, field := range fields {2182 switch field.Name {2183 case "__typename":2184 out.Values[i] = graphql.MarshalString("__Type")2185 case "kind":2186 out.Values[i] = ec.___Type_kind(ctx, field, obj)2187 if out.Values[i] == graphql.Null {2188 invalids++2189 }2190 case "name":2191 out.Values[i] = ec.___Type_name(ctx, field, obj)2192 case "description":2193 out.Values[i] = ec.___Type_description(ctx, field, obj)2194 case "fields":2195 out.Values[i] = ec.___Type_fields(ctx, field, obj)2196 case "interfaces":2197 out.Values[i] = ec.___Type_interfaces(ctx, field, obj)2198 case "possibleTypes":2199 out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj)2200 case "enumValues":2201 out.Values[i] = ec.___Type_enumValues(ctx, field, obj)2202 case "inputFields":2203 out.Values[i] = ec.___Type_inputFields(ctx, field, obj)2204 case "ofType":2205 out.Values[i] = ec.___Type_ofType(ctx, field, obj)2206 default:2207 panic("unknown field " + strconv.Quote(field.Name))2208 }2209 }2210 out.Dispatch()2211 if invalids > 0 {2212 return graphql.Null2213 }2214 return out2215}2216// endregion **************************** object.gotpl ****************************2217// region ***************************** type.gotpl *****************************2218func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) {2219 res, err := graphql.UnmarshalBoolean(v)2220 return res, graphql.ErrorOnPath(ctx, err)2221}2222func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler {2223 res := graphql.MarshalBoolean(v)2224 if res == graphql.Null {2225 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {2226 ec.Errorf(ctx, "must not be null")2227 }2228 }2229 return res2230}2231func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) {2232 res, err := graphql.UnmarshalID(v)2233 return res, graphql.ErrorOnPath(ctx, err)2234}2235func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {2236 res := graphql.MarshalID(v)2237 if res == graphql.Null {2238 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {2239 ec.Errorf(ctx, "must not be null")2240 }2241 }2242 return res2243}2244func (ec *executionContext) marshalNMessage2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋchatᚐMessage(ctx context.Context, sel ast.SelectionSet, v Message) graphql.Marshaler {2245 return ec._Message(ctx, sel, &v)2246}2247func (ec *executionContext) marshalNMessage2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋchatᚐMessageᚄ(ctx context.Context, sel ast.SelectionSet, v []Message) graphql.Marshaler {2248 ret := make(graphql.Array, len(v))2249 var wg sync.WaitGroup2250 isLen1 := len(v) == 12251 if !isLen1 {2252 wg.Add(len(v))2253 }2254 for i := range v {2255 i := i2256 fc := &graphql.FieldContext{2257 Index: &i,2258 Result: &v[i],2259 }2260 ctx := graphql.WithFieldContext(ctx, fc)2261 f := func(i int) {2262 defer func() {2263 if r := recover(); r != nil {2264 ec.Error(ctx, ec.Recover(ctx, r))2265 ret = nil2266 }2267 }()2268 if !isLen1 {2269 defer wg.Done()2270 }2271 ret[i] = ec.marshalNMessage2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋchatᚐMessage(ctx, sel, v[i])2272 }2273 if isLen1 {2274 f(i)2275 } else {2276 go f(i)2277 }2278 }2279 wg.Wait()2280 for _, e := range ret {2281 if e == graphql.Null {2282 return graphql.Null2283 }2284 }2285 return ret2286}2287func (ec *executionContext) marshalNMessage2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋchatᚐMessage(ctx context.Context, sel ast.SelectionSet, v *Message) graphql.Marshaler {2288 if v == nil {2289 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {2290 ec.Errorf(ctx, "must not be null")2291 }2292 return graphql.Null2293 }2294 return ec._Message(ctx, sel, v)2295}2296func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) {2297 res, err := graphql.UnmarshalString(v)2298 return res, graphql.ErrorOnPath(ctx, err)2299}2300func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {2301 res := graphql.MarshalString(v)2302 if res == graphql.Null {2303 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {2304 ec.Errorf(ctx, "must not be null")2305 }2306 }2307 return res2308}2309func (ec *executionContext) unmarshalNTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) {2310 res, err := graphql.UnmarshalTime(v)...

Full Screen

Full Screen

test_unicode.go

Source:test_unicode.go Github

copy

Full Screen

...14 args["role"] = arg015 var arg1 string16 if tmp, ok := rawArgs["emailAddress"]; ok {17 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailAddress"))18 arg1, err = ec.unmarshalNString2string(ctx, tmp)19 if err != nil {20 return nil, err21 }22 }23 args["emailAddress"] = arg124 var arg2 string25 if tmp, ok := rawArgs["password"]; ok {26 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("password"))27 arg2, err = ec.unmarshalNString2string(ctx, tmp)28 if err != nil {29 return nil, err30 }31 }32 args["password"] = arg233 var arg3 *uuid.UUID34 if tmp, ok := rawArgs["organisationId"]; ok {35 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organisationId"))36 arg3, err = ec.unmarshalOUUID2ᚖgithubᚗcomᚋgofrsᚋuuidᚐUUID(ctx, tmp)37 if err != nil {38 return nil, err39 }40 }41 args["organisationId"] = arg3...

Full Screen

Full Screen

unmarshalNString2string

Using AI Code Generation

copy

Full Screen

1import proto "github.com/golang/protobuf/proto"2import fmt "fmt"3import math "math"4import google_protobuf "github.com/golang/protobuf/ptypes/any"5import (6type MyMessage struct {

Full Screen

Full Screen

unmarshalNString2string

Using AI Code Generation

copy

Full Screen

1func main() {2 var jsonStr = []byte(`{"id": "1", "name": "John", "age": "30"}`)3 err := json.Unmarshal(jsonStr, &p)4 if err != nil {5 fmt.Println(err)6 }7 fmt.Println(p)8}9func main() {10 var jsonStr = []byte(`{"id": "1", "name": "John", "age": "30"}`)11 err := json.Unmarshal(jsonStr, &p)12 if err != nil {13 fmt.Println(err)14 }15 fmt.Println(p)16}17func main() {18 var jsonStr = []byte(`{"id": "1", "name": "John", "age": "30"}`)19 err := json.Unmarshal(jsonStr, &p)20 if err != nil {21 fmt.Println(err)22 }23 fmt.Println(p)24}25func main() {26 var jsonStr = []byte(`{"id": "1", "name": "John", "age": "30"}`)27 err := json.Unmarshal(jsonStr, &p)28 if err != nil {29 fmt.Println(err)30 }31 fmt.Println(p)32}33func main() {34 var jsonStr = []byte(`{"id": "1", "name": "John", "age": "30"}`)35 err := json.Unmarshal(jsonStr, &p)36 if err != nil {37 fmt.Println(err)38 }39 fmt.Println(p)40}41func main() {

Full Screen

Full Screen

unmarshalNString2string

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 fmt.Println(x.InvoiceNumber)4 fmt.Println(x.UnMarshalNString2String(x.InvoiceNumber))5}6import (7func main() {8 fmt.Println(x.InvoiceNumber)9 fmt.Println(x.UnMarshalNString2String(x.InvoiceNumber))10}11import (12func main() {13 fmt.Println(x.InvoiceNumber)14 fmt.Println(x.UnMarshalNString2String(x.InvoiceNumber))15}16import (17func main() {18 fmt.Println(x.InvoiceNumber)19 fmt.Println(x.UnMarshalNString2String(x.InvoiceNumber))20}21import (

Full Screen

Full Screen

unmarshalNString2string

Using AI Code Generation

copy

Full Screen

1func (t *Test) UnmarshalNString2String(data []byte) (string, error) {2 err := xml.Unmarshal(data, &s)3}4func (t *Test) MarshalNString2String(s string) ([]byte, error) {5 return xml.Marshal(s)6}7func (t *Test) UnmarshalName(data []byte) (string, error) {8 err := xml.Unmarshal(data, &s)9}10func (t *Test) MarshalName(s string) ([]byte, error) {11 return xml.Marshal(s)12}

Full Screen

Full Screen

unmarshalNString2string

Using AI Code Generation

copy

Full Screen

1import (2type A struct {3}4func main() {5 strPtr := (*string)(unsafe.Pointer(&str))6 strHdr := (*reflect.StringHeader)(unsafe.Pointer(strPtr))7 strData := (*[]byte)(unsafe.Pointer(strHdr.Data))8 strArray := (*[1<<31 - 1]byte)(unsafe.Pointer(strData))9 newStrPtr := (*string)(unsafe.Pointer(&newStr))10 newStrHdr := (*reflect.StringHeader)(unsafe.Pointer(newStrPtr))11 newStrData := (*[]byte)(unsafe.Pointer(newStrHdr.Data))12 newStrArray := (*[1<<31 - 1]byte)(unsafe.Pointer(newStrData))13 for i := 0; i < len(newStr); i++ {14 (*strArray)[i] = (*newStrArray)[i]15 }16 fmt.Println(str)17}18import (19type A struct {20}21type B struct {22}23func main() {24 a := A{Str: "hello"}25 b := B{Str: "world"}26 fmt.Println(a)27 fmt.Println(b)28}

Full Screen

Full Screen

unmarshalNString2string

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 c, err = mylib.NewClass1FromFile("class1.xml")4 if err != nil {5 fmt.Println("Error: ", err)6 os.Exit(1)7 }8 fmt.Println("Unmarshaled class1")9 fmt.Println("Field1: ", c.Field1())10 fmt.Println("Field2: ", c.Field2())11 fmt.Println("Field3: ", c.Field3())12 fmt.Println("Field4: ", c.Field4())13 fmt.Println("Field5: ", c.Field5())14 fmt.Println("Field6: ", c.Field6())15 fmt.Println("Field7: ", c.Field7())16 fmt.Println("Field8: ", c.Field8())17 fmt.Println("Field9: ", c.Field9())18 fmt.Println("Field10: ", c.Field10())19 fmt.Println("Field11: ", c.Field11())20 fmt.Println("Field12: ", c.Field12())21 fmt.Println("Field13: ", c.Field13())22 fmt.Println("Field14: ", c.Field14())23 fmt.Println("Field15: ", c.Field15())24 fmt.Println("Field16: ", c.Field16())25 fmt.Println("Field17: ", c.Field17())26 fmt.Println("Field18: ", c.Field18())27 fmt.Println("Field19: ", c.Field19())28 fmt.Println("Field20: ", c.Field20())29 fmt.Println("Field21: ", c.Field21())30 fmt.Println("Field22: ", c.Field22())31 fmt.Println("Field23: ", c.Field23())32 fmt.Println("Field24: ", c.Field24())33 fmt.Println("Field25: ", c.Field25())34 fmt.Println("Field26: ", c.Field26())35 fmt.Println("Field27: ", c.Field27())36 fmt.Println("Field28: ", c.Field28())37 fmt.Println("Field29: ", c.Field29())38 fmt.Println("Field30: ", c.Field30())39 fmt.Println("Field31: ", c.Field31())40 fmt.Println("Field32: ", c.Field32())41 fmt.Println("Field33: ", c.Field33())42 fmt.Println("Field34: ", c.Field34())43 fmt.Println("Field35: ", c.Field35())44 fmt.Println("Field36: ", c.Field36())45 fmt.Println("

Full Screen

Full Screen

unmarshalNString2string

Using AI Code Generation

copy

Full Screen

1var obj = new 1();2obj.unmarshalNString2string("Hello");3var obj = new 1();4obj.marshalNString2string("Hello");5var obj = new 1();6obj.unmarshalNString2string("Hello");7var obj = new 1();8obj.marshalNString2string("Hello");

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