github.com/operandinc/gqlgen@v0.16.1/codegen/testserver/followschema/enum.generated.go (about)

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