...

Source file src/github.com/99designs/gqlgen/codegen/testserver/followschema/mutation_with_custom_scalar.generated.go

Documentation: github.com/99designs/gqlgen/codegen/testserver/followschema

     1  // Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
     2  
     3  package followschema
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/99designs/gqlgen/graphql"
     9  	"github.com/vektah/gqlparser/v2/ast"
    10  )
    11  
    12  // region    ************************** generated!.gotpl **************************
    13  
    14  // endregion ************************** generated!.gotpl **************************
    15  
    16  // region    ***************************** args.gotpl *****************************
    17  
    18  // endregion ***************************** args.gotpl *****************************
    19  
    20  // region    ************************** directives.gotpl **************************
    21  
    22  // endregion ************************** directives.gotpl **************************
    23  
    24  // region    **************************** field.gotpl *****************************
    25  
    26  // endregion **************************** field.gotpl *****************************
    27  
    28  // region    **************************** input.gotpl *****************************
    29  
    30  func (ec *executionContext) unmarshalInputNestedInput(ctx context.Context, obj interface{}) (NestedInput, error) {
    31  	var it NestedInput
    32  	asMap := map[string]interface{}{}
    33  	for k, v := range obj.(map[string]interface{}) {
    34  		asMap[k] = v
    35  	}
    36  
    37  	fieldsInOrder := [...]string{"field"}
    38  	for _, k := range fieldsInOrder {
    39  		v, ok := asMap[k]
    40  		if !ok {
    41  			continue
    42  		}
    43  		switch k {
    44  		case "field":
    45  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field"))
    46  			data, err := ec.unmarshalNEmail2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐEmail(ctx, v)
    47  			if err != nil {
    48  				return it, err
    49  			}
    50  			it.Field = data
    51  		}
    52  	}
    53  
    54  	return it, nil
    55  }
    56  
    57  func (ec *executionContext) unmarshalInputSpecialInput(ctx context.Context, obj interface{}) (SpecialInput, error) {
    58  	var it SpecialInput
    59  	asMap := map[string]interface{}{}
    60  	for k, v := range obj.(map[string]interface{}) {
    61  		asMap[k] = v
    62  	}
    63  
    64  	fieldsInOrder := [...]string{"nesting"}
    65  	for _, k := range fieldsInOrder {
    66  		v, ok := asMap[k]
    67  		if !ok {
    68  			continue
    69  		}
    70  		switch k {
    71  		case "nesting":
    72  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nesting"))
    73  			data, err := ec.unmarshalNNestedInput2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐNestedInput(ctx, v)
    74  			if err != nil {
    75  				return it, err
    76  			}
    77  			it.Nesting = data
    78  		}
    79  	}
    80  
    81  	return it, nil
    82  }
    83  
    84  // endregion **************************** input.gotpl *****************************
    85  
    86  // region    ************************** interface.gotpl ***************************
    87  
    88  // endregion ************************** interface.gotpl ***************************
    89  
    90  // region    **************************** object.gotpl ****************************
    91  
    92  // endregion **************************** object.gotpl ****************************
    93  
    94  // region    ***************************** type.gotpl *****************************
    95  
    96  func (ec *executionContext) unmarshalNEmail2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐEmail(ctx context.Context, v interface{}) (Email, error) {
    97  	var res Email
    98  	err := res.UnmarshalGQL(v)
    99  	return res, graphql.ErrorOnPath(ctx, err)
   100  }
   101  
   102  func (ec *executionContext) marshalNEmail2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐEmail(ctx context.Context, sel ast.SelectionSet, v Email) graphql.Marshaler {
   103  	return v
   104  }
   105  
   106  func (ec *executionContext) unmarshalNNestedInput2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐNestedInput(ctx context.Context, v interface{}) (*NestedInput, error) {
   107  	res, err := ec.unmarshalInputNestedInput(ctx, v)
   108  	return &res, graphql.ErrorOnPath(ctx, err)
   109  }
   110  
   111  func (ec *executionContext) unmarshalNSpecialInput2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐSpecialInput(ctx context.Context, v interface{}) (SpecialInput, error) {
   112  	res, err := ec.unmarshalInputSpecialInput(ctx, v)
   113  	return res, graphql.ErrorOnPath(ctx, err)
   114  }
   115  
   116  // endregion ***************************** type.gotpl *****************************
   117  

View as plain text