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

     1  // Code generated by github.com/operandinc/gqlgen, DO NOT EDIT.
     2  
     3  package followschema
     4  
     5  import (
     6  	"context"
     7  	"fmt"
     8  	"strconv"
     9  
    10  	"github.com/operandinc/gqlgen/graphql"
    11  	"github.com/vektah/gqlparser/v2/ast"
    12  )
    13  
    14  // region    ************************** generated!.gotpl **************************
    15  
    16  // endregion ************************** generated!.gotpl **************************
    17  
    18  // region    ***************************** args.gotpl *****************************
    19  
    20  func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
    21  	var err error
    22  	args := map[string]interface{}{}
    23  	var arg0 string
    24  	if tmp, ok := rawArgs["break"]; ok {
    25  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("break"))
    26  		arg0, err = ec.unmarshalNString2string(ctx, tmp)
    27  		if err != nil {
    28  			return nil, err
    29  		}
    30  	}
    31  	args["break"] = arg0
    32  	var arg1 string
    33  	if tmp, ok := rawArgs["default"]; ok {
    34  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("default"))
    35  		arg1, err = ec.unmarshalNString2string(ctx, tmp)
    36  		if err != nil {
    37  			return nil, err
    38  		}
    39  	}
    40  	args["default"] = arg1
    41  	var arg2 string
    42  	if tmp, ok := rawArgs["func"]; ok {
    43  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("func"))
    44  		arg2, err = ec.unmarshalNString2string(ctx, tmp)
    45  		if err != nil {
    46  			return nil, err
    47  		}
    48  	}
    49  	args["func"] = arg2
    50  	var arg3 string
    51  	if tmp, ok := rawArgs["interface"]; ok {
    52  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("interface"))
    53  		arg3, err = ec.unmarshalNString2string(ctx, tmp)
    54  		if err != nil {
    55  			return nil, err
    56  		}
    57  	}
    58  	args["interface"] = arg3
    59  	var arg4 string
    60  	if tmp, ok := rawArgs["select"]; ok {
    61  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("select"))
    62  		arg4, err = ec.unmarshalNString2string(ctx, tmp)
    63  		if err != nil {
    64  			return nil, err
    65  		}
    66  	}
    67  	args["select"] = arg4
    68  	var arg5 string
    69  	if tmp, ok := rawArgs["case"]; ok {
    70  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("case"))
    71  		arg5, err = ec.unmarshalNString2string(ctx, tmp)
    72  		if err != nil {
    73  			return nil, err
    74  		}
    75  	}
    76  	args["case"] = arg5
    77  	var arg6 string
    78  	if tmp, ok := rawArgs["defer"]; ok {
    79  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("defer"))
    80  		arg6, err = ec.unmarshalNString2string(ctx, tmp)
    81  		if err != nil {
    82  			return nil, err
    83  		}
    84  	}
    85  	args["defer"] = arg6
    86  	var arg7 string
    87  	if tmp, ok := rawArgs["go"]; ok {
    88  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("go"))
    89  		arg7, err = ec.unmarshalNString2string(ctx, tmp)
    90  		if err != nil {
    91  			return nil, err
    92  		}
    93  	}
    94  	args["go"] = arg7
    95  	var arg8 string
    96  	if tmp, ok := rawArgs["map"]; ok {
    97  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("map"))
    98  		arg8, err = ec.unmarshalNString2string(ctx, tmp)
    99  		if err != nil {
   100  			return nil, err
   101  		}
   102  	}
   103  	args["map"] = arg8
   104  	var arg9 string
   105  	if tmp, ok := rawArgs["struct"]; ok {
   106  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("struct"))
   107  		arg9, err = ec.unmarshalNString2string(ctx, tmp)
   108  		if err != nil {
   109  			return nil, err
   110  		}
   111  	}
   112  	args["struct"] = arg9
   113  	var arg10 string
   114  	if tmp, ok := rawArgs["chan"]; ok {
   115  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("chan"))
   116  		arg10, err = ec.unmarshalNString2string(ctx, tmp)
   117  		if err != nil {
   118  			return nil, err
   119  		}
   120  	}
   121  	args["chan"] = arg10
   122  	var arg11 string
   123  	if tmp, ok := rawArgs["else"]; ok {
   124  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("else"))
   125  		arg11, err = ec.unmarshalNString2string(ctx, tmp)
   126  		if err != nil {
   127  			return nil, err
   128  		}
   129  	}
   130  	args["else"] = arg11
   131  	var arg12 string
   132  	if tmp, ok := rawArgs["goto"]; ok {
   133  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("goto"))
   134  		arg12, err = ec.unmarshalNString2string(ctx, tmp)
   135  		if err != nil {
   136  			return nil, err
   137  		}
   138  	}
   139  	args["goto"] = arg12
   140  	var arg13 string
   141  	if tmp, ok := rawArgs["package"]; ok {
   142  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("package"))
   143  		arg13, err = ec.unmarshalNString2string(ctx, tmp)
   144  		if err != nil {
   145  			return nil, err
   146  		}
   147  	}
   148  	args["package"] = arg13
   149  	var arg14 string
   150  	if tmp, ok := rawArgs["switch"]; ok {
   151  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("switch"))
   152  		arg14, err = ec.unmarshalNString2string(ctx, tmp)
   153  		if err != nil {
   154  			return nil, err
   155  		}
   156  	}
   157  	args["switch"] = arg14
   158  	var arg15 string
   159  	if tmp, ok := rawArgs["const"]; ok {
   160  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("const"))
   161  		arg15, err = ec.unmarshalNString2string(ctx, tmp)
   162  		if err != nil {
   163  			return nil, err
   164  		}
   165  	}
   166  	args["const"] = arg15
   167  	var arg16 string
   168  	if tmp, ok := rawArgs["fallthrough"]; ok {
   169  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fallthrough"))
   170  		arg16, err = ec.unmarshalNString2string(ctx, tmp)
   171  		if err != nil {
   172  			return nil, err
   173  		}
   174  	}
   175  	args["fallthrough"] = arg16
   176  	var arg17 string
   177  	if tmp, ok := rawArgs["if"]; ok {
   178  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("if"))
   179  		arg17, err = ec.unmarshalNString2string(ctx, tmp)
   180  		if err != nil {
   181  			return nil, err
   182  		}
   183  	}
   184  	args["if"] = arg17
   185  	var arg18 string
   186  	if tmp, ok := rawArgs["range"]; ok {
   187  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("range"))
   188  		arg18, err = ec.unmarshalNString2string(ctx, tmp)
   189  		if err != nil {
   190  			return nil, err
   191  		}
   192  	}
   193  	args["range"] = arg18
   194  	var arg19 string
   195  	if tmp, ok := rawArgs["type"]; ok {
   196  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type"))
   197  		arg19, err = ec.unmarshalNString2string(ctx, tmp)
   198  		if err != nil {
   199  			return nil, err
   200  		}
   201  	}
   202  	args["type"] = arg19
   203  	var arg20 string
   204  	if tmp, ok := rawArgs["continue"]; ok {
   205  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("continue"))
   206  		arg20, err = ec.unmarshalNString2string(ctx, tmp)
   207  		if err != nil {
   208  			return nil, err
   209  		}
   210  	}
   211  	args["continue"] = arg20
   212  	var arg21 string
   213  	if tmp, ok := rawArgs["for"]; ok {
   214  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("for"))
   215  		arg21, err = ec.unmarshalNString2string(ctx, tmp)
   216  		if err != nil {
   217  			return nil, err
   218  		}
   219  	}
   220  	args["for"] = arg21
   221  	var arg22 string
   222  	if tmp, ok := rawArgs["import"]; ok {
   223  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("import"))
   224  		arg22, err = ec.unmarshalNString2string(ctx, tmp)
   225  		if err != nil {
   226  			return nil, err
   227  		}
   228  	}
   229  	args["import"] = arg22
   230  	var arg23 string
   231  	if tmp, ok := rawArgs["return"]; ok {
   232  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("return"))
   233  		arg23, err = ec.unmarshalNString2string(ctx, tmp)
   234  		if err != nil {
   235  			return nil, err
   236  		}
   237  	}
   238  	args["return"] = arg23
   239  	var arg24 string
   240  	if tmp, ok := rawArgs["var"]; ok {
   241  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("var"))
   242  		arg24, err = ec.unmarshalNString2string(ctx, tmp)
   243  		if err != nil {
   244  			return nil, err
   245  		}
   246  	}
   247  	args["var"] = arg24
   248  	var arg25 string
   249  	if tmp, ok := rawArgs["_"]; ok {
   250  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_"))
   251  		arg25, err = ec.unmarshalNString2string(ctx, tmp)
   252  		if err != nil {
   253  			return nil, err
   254  		}
   255  	}
   256  	args["_"] = arg25
   257  	return args, nil
   258  }
   259  
   260  func (ec *executionContext) field_ValidType_validInputKeywords_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
   261  	var err error
   262  	args := map[string]interface{}{}
   263  	var arg0 *ValidInput
   264  	if tmp, ok := rawArgs["input"]; ok {
   265  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input"))
   266  		arg0, err = ec.unmarshalOValidInput2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐValidInput(ctx, tmp)
   267  		if err != nil {
   268  			return nil, err
   269  		}
   270  	}
   271  	args["input"] = arg0
   272  	return args, nil
   273  }
   274  
   275  // endregion ***************************** args.gotpl *****************************
   276  
   277  // region    ************************** directives.gotpl **************************
   278  
   279  // endregion ************************** directives.gotpl **************************
   280  
   281  // region    **************************** field.gotpl *****************************
   282  
   283  func (ec *executionContext) _Content_Post_foo(ctx context.Context, field graphql.CollectedField, obj *ContentPost) (ret graphql.Marshaler) {
   284  	defer func() {
   285  		if r := recover(); r != nil {
   286  			ec.Error(ctx, ec.Recover(ctx, r))
   287  			ret = graphql.Null
   288  		}
   289  	}()
   290  	fc := &graphql.FieldContext{
   291  		Object:     "Content_Post",
   292  		Field:      field,
   293  		Args:       nil,
   294  		IsMethod:   false,
   295  		IsResolver: false,
   296  	}
   297  
   298  	ctx = graphql.WithFieldContext(ctx, fc)
   299  	resTmp := ec._fieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) {
   300  		ctx = rctx // use context from middleware stack in children
   301  		return obj.Foo, nil
   302  	})
   303  
   304  	if resTmp == nil {
   305  		return graphql.Null
   306  	}
   307  	res := resTmp.(*string)
   308  	fc.Result = res
   309  	return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
   310  }
   311  
   312  func (ec *executionContext) _Content_User_foo(ctx context.Context, field graphql.CollectedField, obj *ContentUser) (ret graphql.Marshaler) {
   313  	defer func() {
   314  		if r := recover(); r != nil {
   315  			ec.Error(ctx, ec.Recover(ctx, r))
   316  			ret = graphql.Null
   317  		}
   318  	}()
   319  	fc := &graphql.FieldContext{
   320  		Object:     "Content_User",
   321  		Field:      field,
   322  		Args:       nil,
   323  		IsMethod:   false,
   324  		IsResolver: false,
   325  	}
   326  
   327  	ctx = graphql.WithFieldContext(ctx, fc)
   328  	resTmp := ec._fieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) {
   329  		ctx = rctx // use context from middleware stack in children
   330  		return obj.Foo, nil
   331  	})
   332  
   333  	if resTmp == nil {
   334  		return graphql.Null
   335  	}
   336  	res := resTmp.(*string)
   337  	fc.Result = res
   338  	return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
   339  }
   340  
   341  func (ec *executionContext) _ValidType_differentCase(ctx context.Context, field graphql.CollectedField, obj *ValidType) (ret graphql.Marshaler) {
   342  	defer func() {
   343  		if r := recover(); r != nil {
   344  			ec.Error(ctx, ec.Recover(ctx, r))
   345  			ret = graphql.Null
   346  		}
   347  	}()
   348  	fc := &graphql.FieldContext{
   349  		Object:     "ValidType",
   350  		Field:      field,
   351  		Args:       nil,
   352  		IsMethod:   false,
   353  		IsResolver: false,
   354  	}
   355  
   356  	ctx = graphql.WithFieldContext(ctx, fc)
   357  	resTmp := ec._fieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) {
   358  		ctx = rctx // use context from middleware stack in children
   359  		return obj.DifferentCase, nil
   360  	})
   361  
   362  	if resTmp == nil {
   363  		if !graphql.HasFieldError(ctx, fc) {
   364  			ec.Errorf(ctx, "must not be null")
   365  		}
   366  		return graphql.Null
   367  	}
   368  	res := resTmp.(string)
   369  	fc.Result = res
   370  	return ec.marshalNString2string(ctx, field.Selections, res)
   371  }
   372  
   373  func (ec *executionContext) _ValidType_different_case(ctx context.Context, field graphql.CollectedField, obj *ValidType) (ret graphql.Marshaler) {
   374  	defer func() {
   375  		if r := recover(); r != nil {
   376  			ec.Error(ctx, ec.Recover(ctx, r))
   377  			ret = graphql.Null
   378  		}
   379  	}()
   380  	fc := &graphql.FieldContext{
   381  		Object:     "ValidType",
   382  		Field:      field,
   383  		Args:       nil,
   384  		IsMethod:   false,
   385  		IsResolver: false,
   386  	}
   387  
   388  	ctx = graphql.WithFieldContext(ctx, fc)
   389  	resTmp := ec._fieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) {
   390  		ctx = rctx // use context from middleware stack in children
   391  		return obj.DifferentCaseOld, nil
   392  	})
   393  
   394  	if resTmp == nil {
   395  		if !graphql.HasFieldError(ctx, fc) {
   396  			ec.Errorf(ctx, "must not be null")
   397  		}
   398  		return graphql.Null
   399  	}
   400  	res := resTmp.(string)
   401  	fc.Result = res
   402  	return ec.marshalNString2string(ctx, field.Selections, res)
   403  }
   404  
   405  func (ec *executionContext) _ValidType_validInputKeywords(ctx context.Context, field graphql.CollectedField, obj *ValidType) (ret graphql.Marshaler) {
   406  	defer func() {
   407  		if r := recover(); r != nil {
   408  			ec.Error(ctx, ec.Recover(ctx, r))
   409  			ret = graphql.Null
   410  		}
   411  	}()
   412  	fc := &graphql.FieldContext{
   413  		Object:     "ValidType",
   414  		Field:      field,
   415  		Args:       nil,
   416  		IsMethod:   false,
   417  		IsResolver: false,
   418  	}
   419  
   420  	ctx = graphql.WithFieldContext(ctx, fc)
   421  	rawArgs := field.ArgumentMap(ec.Variables)
   422  	args, err := ec.field_ValidType_validInputKeywords_args(ctx, rawArgs)
   423  	if err != nil {
   424  		ec.Error(ctx, err)
   425  		return graphql.Null
   426  	}
   427  	fc.Args = args
   428  	resTmp := ec._fieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) {
   429  		ctx = rctx // use context from middleware stack in children
   430  		return obj.ValidInputKeywords, nil
   431  	})
   432  
   433  	if resTmp == nil {
   434  		if !graphql.HasFieldError(ctx, fc) {
   435  			ec.Errorf(ctx, "must not be null")
   436  		}
   437  		return graphql.Null
   438  	}
   439  	res := resTmp.(bool)
   440  	fc.Result = res
   441  	return ec.marshalNBoolean2bool(ctx, field.Selections, res)
   442  }
   443  
   444  func (ec *executionContext) _ValidType_validArgs(ctx context.Context, field graphql.CollectedField, obj *ValidType) (ret graphql.Marshaler) {
   445  	defer func() {
   446  		if r := recover(); r != nil {
   447  			ec.Error(ctx, ec.Recover(ctx, r))
   448  			ret = graphql.Null
   449  		}
   450  	}()
   451  	fc := &graphql.FieldContext{
   452  		Object:     "ValidType",
   453  		Field:      field,
   454  		Args:       nil,
   455  		IsMethod:   false,
   456  		IsResolver: false,
   457  	}
   458  
   459  	ctx = graphql.WithFieldContext(ctx, fc)
   460  	rawArgs := field.ArgumentMap(ec.Variables)
   461  	args, err := ec.field_ValidType_validArgs_args(ctx, rawArgs)
   462  	if err != nil {
   463  		ec.Error(ctx, err)
   464  		return graphql.Null
   465  	}
   466  	fc.Args = args
   467  	resTmp := ec._fieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) {
   468  		ctx = rctx // use context from middleware stack in children
   469  		return obj.ValidArgs, nil
   470  	})
   471  
   472  	if resTmp == nil {
   473  		if !graphql.HasFieldError(ctx, fc) {
   474  			ec.Errorf(ctx, "must not be null")
   475  		}
   476  		return graphql.Null
   477  	}
   478  	res := resTmp.(bool)
   479  	fc.Result = res
   480  	return ec.marshalNBoolean2bool(ctx, field.Selections, res)
   481  }
   482  
   483  // endregion **************************** field.gotpl *****************************
   484  
   485  // region    **************************** input.gotpl *****************************
   486  
   487  func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj interface{}) (ValidInput, error) {
   488  	var it ValidInput
   489  	asMap := map[string]interface{}{}
   490  	for k, v := range obj.(map[string]interface{}) {
   491  		asMap[k] = v
   492  	}
   493  
   494  	for k, v := range asMap {
   495  		switch k {
   496  		case "break":
   497  			var err error
   498  
   499  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("break"))
   500  			it.Break, err = ec.unmarshalNString2string(ctx, v)
   501  			if err != nil {
   502  				return it, err
   503  			}
   504  		case "default":
   505  			var err error
   506  
   507  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("default"))
   508  			it.Default, err = ec.unmarshalNString2string(ctx, v)
   509  			if err != nil {
   510  				return it, err
   511  			}
   512  		case "func":
   513  			var err error
   514  
   515  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("func"))
   516  			it.Func, err = ec.unmarshalNString2string(ctx, v)
   517  			if err != nil {
   518  				return it, err
   519  			}
   520  		case "interface":
   521  			var err error
   522  
   523  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("interface"))
   524  			it.Interface, err = ec.unmarshalNString2string(ctx, v)
   525  			if err != nil {
   526  				return it, err
   527  			}
   528  		case "select":
   529  			var err error
   530  
   531  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("select"))
   532  			it.Select, err = ec.unmarshalNString2string(ctx, v)
   533  			if err != nil {
   534  				return it, err
   535  			}
   536  		case "case":
   537  			var err error
   538  
   539  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("case"))
   540  			it.Case, err = ec.unmarshalNString2string(ctx, v)
   541  			if err != nil {
   542  				return it, err
   543  			}
   544  		case "defer":
   545  			var err error
   546  
   547  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("defer"))
   548  			it.Defer, err = ec.unmarshalNString2string(ctx, v)
   549  			if err != nil {
   550  				return it, err
   551  			}
   552  		case "go":
   553  			var err error
   554  
   555  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("go"))
   556  			it.Go, err = ec.unmarshalNString2string(ctx, v)
   557  			if err != nil {
   558  				return it, err
   559  			}
   560  		case "map":
   561  			var err error
   562  
   563  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("map"))
   564  			it.Map, err = ec.unmarshalNString2string(ctx, v)
   565  			if err != nil {
   566  				return it, err
   567  			}
   568  		case "struct":
   569  			var err error
   570  
   571  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("struct"))
   572  			it.Struct, err = ec.unmarshalNString2string(ctx, v)
   573  			if err != nil {
   574  				return it, err
   575  			}
   576  		case "chan":
   577  			var err error
   578  
   579  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("chan"))
   580  			it.Chan, err = ec.unmarshalNString2string(ctx, v)
   581  			if err != nil {
   582  				return it, err
   583  			}
   584  		case "else":
   585  			var err error
   586  
   587  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("else"))
   588  			it.Else, err = ec.unmarshalNString2string(ctx, v)
   589  			if err != nil {
   590  				return it, err
   591  			}
   592  		case "goto":
   593  			var err error
   594  
   595  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("goto"))
   596  			it.Goto, err = ec.unmarshalNString2string(ctx, v)
   597  			if err != nil {
   598  				return it, err
   599  			}
   600  		case "package":
   601  			var err error
   602  
   603  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("package"))
   604  			it.Package, err = ec.unmarshalNString2string(ctx, v)
   605  			if err != nil {
   606  				return it, err
   607  			}
   608  		case "switch":
   609  			var err error
   610  
   611  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("switch"))
   612  			it.Switch, err = ec.unmarshalNString2string(ctx, v)
   613  			if err != nil {
   614  				return it, err
   615  			}
   616  		case "const":
   617  			var err error
   618  
   619  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("const"))
   620  			it.Const, err = ec.unmarshalNString2string(ctx, v)
   621  			if err != nil {
   622  				return it, err
   623  			}
   624  		case "fallthrough":
   625  			var err error
   626  
   627  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fallthrough"))
   628  			it.Fallthrough, err = ec.unmarshalNString2string(ctx, v)
   629  			if err != nil {
   630  				return it, err
   631  			}
   632  		case "if":
   633  			var err error
   634  
   635  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("if"))
   636  			it.If, err = ec.unmarshalNString2string(ctx, v)
   637  			if err != nil {
   638  				return it, err
   639  			}
   640  		case "range":
   641  			var err error
   642  
   643  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("range"))
   644  			it.Range, err = ec.unmarshalNString2string(ctx, v)
   645  			if err != nil {
   646  				return it, err
   647  			}
   648  		case "type":
   649  			var err error
   650  
   651  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type"))
   652  			it.Type, err = ec.unmarshalNString2string(ctx, v)
   653  			if err != nil {
   654  				return it, err
   655  			}
   656  		case "continue":
   657  			var err error
   658  
   659  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("continue"))
   660  			it.Continue, err = ec.unmarshalNString2string(ctx, v)
   661  			if err != nil {
   662  				return it, err
   663  			}
   664  		case "for":
   665  			var err error
   666  
   667  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("for"))
   668  			it.For, err = ec.unmarshalNString2string(ctx, v)
   669  			if err != nil {
   670  				return it, err
   671  			}
   672  		case "import":
   673  			var err error
   674  
   675  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("import"))
   676  			it.Import, err = ec.unmarshalNString2string(ctx, v)
   677  			if err != nil {
   678  				return it, err
   679  			}
   680  		case "return":
   681  			var err error
   682  
   683  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("return"))
   684  			it.Return, err = ec.unmarshalNString2string(ctx, v)
   685  			if err != nil {
   686  				return it, err
   687  			}
   688  		case "var":
   689  			var err error
   690  
   691  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("var"))
   692  			it.Var, err = ec.unmarshalNString2string(ctx, v)
   693  			if err != nil {
   694  				return it, err
   695  			}
   696  		case "_":
   697  			var err error
   698  
   699  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_"))
   700  			it.Underscore, err = ec.unmarshalNString2string(ctx, v)
   701  			if err != nil {
   702  				return it, err
   703  			}
   704  		}
   705  	}
   706  
   707  	return it, nil
   708  }
   709  
   710  // endregion **************************** input.gotpl *****************************
   711  
   712  // region    ************************** interface.gotpl ***************************
   713  
   714  func (ec *executionContext) _Content_Child(ctx context.Context, sel ast.SelectionSet, obj ContentChild) graphql.Marshaler {
   715  	switch obj := (obj).(type) {
   716  	case nil:
   717  		return graphql.Null
   718  	case ContentUser:
   719  		return ec._Content_User(ctx, sel, &obj)
   720  	case *ContentUser:
   721  		if obj == nil {
   722  			return graphql.Null
   723  		}
   724  		return ec._Content_User(ctx, sel, obj)
   725  	case ContentPost:
   726  		return ec._Content_Post(ctx, sel, &obj)
   727  	case *ContentPost:
   728  		if obj == nil {
   729  			return graphql.Null
   730  		}
   731  		return ec._Content_Post(ctx, sel, obj)
   732  	default:
   733  		panic(fmt.Errorf("unexpected type %T", obj))
   734  	}
   735  }
   736  
   737  // endregion ************************** interface.gotpl ***************************
   738  
   739  // region    **************************** object.gotpl ****************************
   740  
   741  var content_PostImplementors = []string{"Content_Post", "Content_Child"}
   742  
   743  func (ec *executionContext) _Content_Post(ctx context.Context, sel ast.SelectionSet, obj *ContentPost) graphql.Marshaler {
   744  	fields := graphql.CollectFields(ec.OperationContext, sel, content_PostImplementors)
   745  	out := graphql.NewFieldSet(fields)
   746  	var invalids uint32
   747  	for i, field := range fields {
   748  		switch field.Name {
   749  		case "__typename":
   750  			out.Values[i] = graphql.MarshalString("Content_Post")
   751  		case "foo":
   752  			innerFunc := func(ctx context.Context) (res graphql.Marshaler) {
   753  				return ec._Content_Post_foo(ctx, field, obj)
   754  			}
   755  
   756  			out.Values[i] = innerFunc(ctx)
   757  
   758  		default:
   759  			panic("unknown field " + strconv.Quote(field.Name))
   760  		}
   761  	}
   762  	out.Dispatch()
   763  	if invalids > 0 {
   764  		return graphql.Null
   765  	}
   766  	return out
   767  }
   768  
   769  var content_UserImplementors = []string{"Content_User", "Content_Child"}
   770  
   771  func (ec *executionContext) _Content_User(ctx context.Context, sel ast.SelectionSet, obj *ContentUser) graphql.Marshaler {
   772  	fields := graphql.CollectFields(ec.OperationContext, sel, content_UserImplementors)
   773  	out := graphql.NewFieldSet(fields)
   774  	var invalids uint32
   775  	for i, field := range fields {
   776  		switch field.Name {
   777  		case "__typename":
   778  			out.Values[i] = graphql.MarshalString("Content_User")
   779  		case "foo":
   780  			innerFunc := func(ctx context.Context) (res graphql.Marshaler) {
   781  				return ec._Content_User_foo(ctx, field, obj)
   782  			}
   783  
   784  			out.Values[i] = innerFunc(ctx)
   785  
   786  		default:
   787  			panic("unknown field " + strconv.Quote(field.Name))
   788  		}
   789  	}
   790  	out.Dispatch()
   791  	if invalids > 0 {
   792  		return graphql.Null
   793  	}
   794  	return out
   795  }
   796  
   797  var validTypeImplementors = []string{"ValidType"}
   798  
   799  func (ec *executionContext) _ValidType(ctx context.Context, sel ast.SelectionSet, obj *ValidType) graphql.Marshaler {
   800  	fields := graphql.CollectFields(ec.OperationContext, sel, validTypeImplementors)
   801  	out := graphql.NewFieldSet(fields)
   802  	var invalids uint32
   803  	for i, field := range fields {
   804  		switch field.Name {
   805  		case "__typename":
   806  			out.Values[i] = graphql.MarshalString("ValidType")
   807  		case "differentCase":
   808  			innerFunc := func(ctx context.Context) (res graphql.Marshaler) {
   809  				return ec._ValidType_differentCase(ctx, field, obj)
   810  			}
   811  
   812  			out.Values[i] = innerFunc(ctx)
   813  
   814  			if out.Values[i] == graphql.Null {
   815  				invalids++
   816  			}
   817  		case "different_case":
   818  			innerFunc := func(ctx context.Context) (res graphql.Marshaler) {
   819  				return ec._ValidType_different_case(ctx, field, obj)
   820  			}
   821  
   822  			out.Values[i] = innerFunc(ctx)
   823  
   824  			if out.Values[i] == graphql.Null {
   825  				invalids++
   826  			}
   827  		case "validInputKeywords":
   828  			innerFunc := func(ctx context.Context) (res graphql.Marshaler) {
   829  				return ec._ValidType_validInputKeywords(ctx, field, obj)
   830  			}
   831  
   832  			out.Values[i] = innerFunc(ctx)
   833  
   834  			if out.Values[i] == graphql.Null {
   835  				invalids++
   836  			}
   837  		case "validArgs":
   838  			innerFunc := func(ctx context.Context) (res graphql.Marshaler) {
   839  				return ec._ValidType_validArgs(ctx, field, obj)
   840  			}
   841  
   842  			out.Values[i] = innerFunc(ctx)
   843  
   844  			if out.Values[i] == graphql.Null {
   845  				invalids++
   846  			}
   847  		default:
   848  			panic("unknown field " + strconv.Quote(field.Name))
   849  		}
   850  	}
   851  	out.Dispatch()
   852  	if invalids > 0 {
   853  		return graphql.Null
   854  	}
   855  	return out
   856  }
   857  
   858  // endregion **************************** object.gotpl ****************************
   859  
   860  // region    ***************************** type.gotpl *****************************
   861  
   862  func (ec *executionContext) unmarshalOValidInput2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐValidInput(ctx context.Context, v interface{}) (*ValidInput, error) {
   863  	if v == nil {
   864  		return nil, nil
   865  	}
   866  	res, err := ec.unmarshalInputValidInput(ctx, v)
   867  	return &res, graphql.ErrorOnPath(ctx, err)
   868  }
   869  
   870  func (ec *executionContext) marshalOValidType2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐValidType(ctx context.Context, sel ast.SelectionSet, v *ValidType) graphql.Marshaler {
   871  	if v == nil {
   872  		return graphql.Null
   873  	}
   874  	return ec._ValidType(ctx, sel, v)
   875  }
   876  
   877  // endregion ***************************** type.gotpl *****************************