github.com/geneva/gqlgen@v0.17.7-0.20230801155730-7b9317164836/codegen/testserver/followschema/enum.generated.go (about)

     1  // Code generated by github.com/geneva/gqlgen, DO NOT EDIT.
     2  
     3  package followschema
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/geneva/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) 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  			data, err := ec.unmarshalNEnumTest2githubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐEnumTest(ctx, v)
    49  			if err != nil {
    50  				return it, err
    51  			}
    52  			it.Enum = data
    53  		}
    54  	}
    55  
    56  	return it, nil
    57  }
    58  
    59  // endregion **************************** input.gotpl *****************************
    60  
    61  // region    ************************** interface.gotpl ***************************
    62  
    63  // endregion ************************** interface.gotpl ***************************
    64  
    65  // region    **************************** object.gotpl ****************************
    66  
    67  // endregion **************************** object.gotpl ****************************
    68  
    69  // region    ***************************** type.gotpl *****************************
    70  
    71  func (ec *executionContext) unmarshalNEnumTest2githubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐEnumTest(ctx context.Context, v interface{}) (EnumTest, error) {
    72  	var res EnumTest
    73  	err := res.UnmarshalGQL(v)
    74  	return res, graphql.ErrorOnPath(ctx, err)
    75  }
    76  
    77  func (ec *executionContext) marshalNEnumTest2githubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐEnumTest(ctx context.Context, sel ast.SelectionSet, v EnumTest) graphql.Marshaler {
    78  	return v
    79  }
    80  
    81  func (ec *executionContext) unmarshalOInputWithEnumValue2ᚖgithubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐInputWithEnumValue(ctx context.Context, v interface{}) (*InputWithEnumValue, error) {
    82  	if v == nil {
    83  		return nil, nil
    84  	}
    85  	res, err := ec.unmarshalInputInputWithEnumValue(ctx, v)
    86  	return &res, graphql.ErrorOnPath(ctx, err)
    87  }
    88  
    89  // endregion ***************************** type.gotpl *****************************