github.com/mstephano/gqlgen-schemagen@v0.0.0-20230113041936-dd2cd4ea46aa/codegen/testserver/followschema/enum.generated.go (about)

     1  // Code generated by github.com/mstephano/gqlgen-schemagen, DO NOT EDIT.
     2  
     3  package followschema
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/mstephano/gqlgen-schemagen/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) unmarshalInputInputWithEnumValue(ctx context.Context, obj interface{}) (InputWithEnumValue, error) {
    31  	var it InputWithEnumValue
    32  	asMap := map[string]interface{}{}
    33  	for k, v := range obj.(map[string]interface{}) {
    34  		asMap[k] = v
    35  	}
    36  
    37  	fieldsInOrder := [...]string{"enum"}
    38  	for _, k := range fieldsInOrder {
    39  		v, ok := asMap[k]
    40  		if !ok {
    41  			continue
    42  		}
    43  		switch k {
    44  		case "enum":
    45  			var err error
    46  
    47  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enum"))
    48  			it.Enum, err = ec.unmarshalNEnumTest2githubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋcodegenᚋtestserverᚋfollowschemaᚐEnumTest(ctx, v)
    49  			if err != nil {
    50  				return it, err
    51  			}
    52  		}
    53  	}
    54  
    55  	return it, nil
    56  }
    57  
    58  // endregion **************************** input.gotpl *****************************
    59  
    60  // region    ************************** interface.gotpl ***************************
    61  
    62  // endregion ************************** interface.gotpl ***************************
    63  
    64  // region    **************************** object.gotpl ****************************
    65  
    66  // endregion **************************** object.gotpl ****************************
    67  
    68  // region    ***************************** type.gotpl *****************************
    69  
    70  func (ec *executionContext) unmarshalNEnumTest2githubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋcodegenᚋtestserverᚋfollowschemaᚐEnumTest(ctx context.Context, v interface{}) (EnumTest, error) {
    71  	var res EnumTest
    72  	err := res.UnmarshalGQL(v)
    73  	return res, graphql.ErrorOnPath(ctx, err)
    74  }
    75  
    76  func (ec *executionContext) marshalNEnumTest2githubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋcodegenᚋtestserverᚋfollowschemaᚐEnumTest(ctx context.Context, sel ast.SelectionSet, v EnumTest) graphql.Marshaler {
    77  	return v
    78  }
    79  
    80  func (ec *executionContext) unmarshalOInputWithEnumValue2ᚖgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋcodegenᚋtestserverᚋfollowschemaᚐInputWithEnumValue(ctx context.Context, v interface{}) (*InputWithEnumValue, error) {
    81  	if v == nil {
    82  		return nil, nil
    83  	}
    84  	res, err := ec.unmarshalInputInputWithEnumValue(ctx, v)
    85  	return &res, graphql.ErrorOnPath(ctx, err)
    86  }
    87  
    88  // endregion ***************************** type.gotpl *****************************