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

     1  // Code generated by github.com/geneva/gqlgen, DO NOT EDIT.
     2  
     3  package followschema
     4  
     5  import (
     6  	"context"
     7  	"errors"
     8  	"fmt"
     9  	"strconv"
    10  	"sync/atomic"
    11  
    12  	"github.com/geneva/gqlgen/graphql"
    13  	"github.com/vektah/gqlparser/v2/ast"
    14  )
    15  
    16  // region    ************************** generated!.gotpl **************************
    17  
    18  // endregion ************************** generated!.gotpl **************************
    19  
    20  // region    ***************************** args.gotpl *****************************
    21  
    22  func (ec *executionContext) dir_length_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
    23  	var err error
    24  	args := map[string]interface{}{}
    25  	var arg0 int
    26  	if tmp, ok := rawArgs["min"]; ok {
    27  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("min"))
    28  		arg0, err = ec.unmarshalNInt2int(ctx, tmp)
    29  		if err != nil {
    30  			return nil, err
    31  		}
    32  	}
    33  	args["min"] = arg0
    34  	var arg1 *int
    35  	if tmp, ok := rawArgs["max"]; ok {
    36  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("max"))
    37  		arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp)
    38  		if err != nil {
    39  			return nil, err
    40  		}
    41  	}
    42  	args["max"] = arg1
    43  	var arg2 *string
    44  	if tmp, ok := rawArgs["message"]; ok {
    45  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("message"))
    46  		arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp)
    47  		if err != nil {
    48  			return nil, err
    49  		}
    50  	}
    51  	args["message"] = arg2
    52  	return args, nil
    53  }
    54  
    55  func (ec *executionContext) dir_logged_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
    56  	var err error
    57  	args := map[string]interface{}{}
    58  	var arg0 string
    59  	if tmp, ok := rawArgs["id"]; ok {
    60  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
    61  		arg0, err = ec.unmarshalNUUID2string(ctx, tmp)
    62  		if err != nil {
    63  			return nil, err
    64  		}
    65  	}
    66  	args["id"] = arg0
    67  	return args, nil
    68  }
    69  
    70  func (ec *executionContext) dir_order1_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
    71  	var err error
    72  	args := map[string]interface{}{}
    73  	var arg0 string
    74  	if tmp, ok := rawArgs["location"]; ok {
    75  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("location"))
    76  		arg0, err = ec.unmarshalNString2string(ctx, tmp)
    77  		if err != nil {
    78  			return nil, err
    79  		}
    80  	}
    81  	args["location"] = arg0
    82  	return args, nil
    83  }
    84  
    85  func (ec *executionContext) dir_order2_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
    86  	var err error
    87  	args := map[string]interface{}{}
    88  	var arg0 string
    89  	if tmp, ok := rawArgs["location"]; ok {
    90  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("location"))
    91  		arg0, err = ec.unmarshalNString2string(ctx, tmp)
    92  		if err != nil {
    93  			return nil, err
    94  		}
    95  	}
    96  	args["location"] = arg0
    97  	return args, nil
    98  }
    99  
   100  func (ec *executionContext) dir_range_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
   101  	var err error
   102  	args := map[string]interface{}{}
   103  	var arg0 *int
   104  	if tmp, ok := rawArgs["min"]; ok {
   105  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("min"))
   106  		arg0, err = ec.unmarshalOInt2ᚖint(ctx, tmp)
   107  		if err != nil {
   108  			return nil, err
   109  		}
   110  	}
   111  	args["min"] = arg0
   112  	var arg1 *int
   113  	if tmp, ok := rawArgs["max"]; ok {
   114  		ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("max"))
   115  		arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp)
   116  		if err != nil {
   117  			return nil, err
   118  		}
   119  	}
   120  	args["max"] = arg1
   121  	return args, nil
   122  }
   123  
   124  // endregion ***************************** args.gotpl *****************************
   125  
   126  // region    ************************** directives.gotpl **************************
   127  
   128  func (ec *executionContext) _fieldMiddleware(ctx context.Context, obj interface{}, next graphql.Resolver) interface{} {
   129  	fc := graphql.GetFieldContext(ctx)
   130  	for _, d := range fc.Field.Directives {
   131  		switch d.Name {
   132  		case "logged":
   133  			rawArgs := d.ArgumentMap(ec.Variables)
   134  			args, err := ec.dir_logged_args(ctx, rawArgs)
   135  			if err != nil {
   136  				ec.Error(ctx, err)
   137  				return nil
   138  			}
   139  			n := next
   140  			next = func(ctx context.Context) (interface{}, error) {
   141  				if ec.directives.Logged == nil {
   142  					return nil, errors.New("directive logged is not implemented")
   143  				}
   144  				return ec.directives.Logged(ctx, obj, n, args["id"].(string))
   145  			}
   146  		}
   147  	}
   148  	res, err := ec.ResolverMiddleware(ctx, next)
   149  	if err != nil {
   150  		ec.Error(ctx, err)
   151  		return nil
   152  	}
   153  	return res
   154  }
   155  
   156  // endregion ************************** directives.gotpl **************************
   157  
   158  // region    **************************** field.gotpl *****************************
   159  
   160  func (ec *executionContext) _ObjectDirectives_text(ctx context.Context, field graphql.CollectedField, obj *ObjectDirectives) (ret graphql.Marshaler) {
   161  	fc, err := ec.fieldContext_ObjectDirectives_text(ctx, field)
   162  	if err != nil {
   163  		return graphql.Null
   164  	}
   165  	ctx = graphql.WithFieldContext(ctx, fc)
   166  	defer func() {
   167  		if r := recover(); r != nil {
   168  			ec.Error(ctx, ec.Recover(ctx, r))
   169  			ret = graphql.Null
   170  		}
   171  	}()
   172  	resTmp := ec._fieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) {
   173  		directive0 := func(rctx context.Context) (interface{}, error) {
   174  			ctx = rctx // use context from middleware stack in children
   175  			return obj.Text, nil
   176  		}
   177  		directive1 := func(ctx context.Context) (interface{}, error) {
   178  			min, err := ec.unmarshalNInt2int(ctx, 0)
   179  			if err != nil {
   180  				return nil, err
   181  			}
   182  			max, err := ec.unmarshalOInt2ᚖint(ctx, 7)
   183  			if err != nil {
   184  				return nil, err
   185  			}
   186  			message, err := ec.unmarshalOString2ᚖstring(ctx, "not valid")
   187  			if err != nil {
   188  				return nil, err
   189  			}
   190  			if ec.directives.Length == nil {
   191  				return nil, errors.New("directive length is not implemented")
   192  			}
   193  			return ec.directives.Length(ctx, obj, directive0, min, max, message)
   194  		}
   195  
   196  		tmp, err := directive1(rctx)
   197  		if err != nil {
   198  			return nil, graphql.ErrorOnPath(ctx, err)
   199  		}
   200  		if tmp == nil {
   201  			return nil, nil
   202  		}
   203  		if data, ok := tmp.(string); ok {
   204  			return data, nil
   205  		}
   206  		return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp)
   207  	})
   208  
   209  	if resTmp == nil {
   210  		if !graphql.HasFieldError(ctx, fc) {
   211  			ec.Errorf(ctx, "must not be null")
   212  		}
   213  		return graphql.Null
   214  	}
   215  	res := resTmp.(string)
   216  	fc.Result = res
   217  	return ec.marshalNString2string(ctx, field.Selections, res)
   218  }
   219  
   220  func (ec *executionContext) fieldContext_ObjectDirectives_text(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
   221  	fc = &graphql.FieldContext{
   222  		Object:     "ObjectDirectives",
   223  		Field:      field,
   224  		IsMethod:   false,
   225  		IsResolver: false,
   226  		Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
   227  			return nil, errors.New("field of type String does not have child fields")
   228  		},
   229  	}
   230  	return fc, nil
   231  }
   232  
   233  func (ec *executionContext) _ObjectDirectives_nullableText(ctx context.Context, field graphql.CollectedField, obj *ObjectDirectives) (ret graphql.Marshaler) {
   234  	fc, err := ec.fieldContext_ObjectDirectives_nullableText(ctx, field)
   235  	if err != nil {
   236  		return graphql.Null
   237  	}
   238  	ctx = graphql.WithFieldContext(ctx, fc)
   239  	defer func() {
   240  		if r := recover(); r != nil {
   241  			ec.Error(ctx, ec.Recover(ctx, r))
   242  			ret = graphql.Null
   243  		}
   244  	}()
   245  	resTmp := ec._fieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) {
   246  		directive0 := func(rctx context.Context) (interface{}, error) {
   247  			ctx = rctx // use context from middleware stack in children
   248  			return obj.NullableText, nil
   249  		}
   250  		directive1 := func(ctx context.Context) (interface{}, error) {
   251  			if ec.directives.ToNull == nil {
   252  				return nil, errors.New("directive toNull is not implemented")
   253  			}
   254  			return ec.directives.ToNull(ctx, obj, directive0)
   255  		}
   256  
   257  		tmp, err := directive1(rctx)
   258  		if err != nil {
   259  			return nil, graphql.ErrorOnPath(ctx, err)
   260  		}
   261  		if tmp == nil {
   262  			return nil, nil
   263  		}
   264  		if data, ok := tmp.(*string); ok {
   265  			return data, nil
   266  		}
   267  		return nil, fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp)
   268  	})
   269  
   270  	if resTmp == nil {
   271  		return graphql.Null
   272  	}
   273  	res := resTmp.(*string)
   274  	fc.Result = res
   275  	return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
   276  }
   277  
   278  func (ec *executionContext) fieldContext_ObjectDirectives_nullableText(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
   279  	fc = &graphql.FieldContext{
   280  		Object:     "ObjectDirectives",
   281  		Field:      field,
   282  		IsMethod:   false,
   283  		IsResolver: false,
   284  		Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
   285  			return nil, errors.New("field of type String does not have child fields")
   286  		},
   287  	}
   288  	return fc, nil
   289  }
   290  
   291  func (ec *executionContext) _ObjectDirectives_order(ctx context.Context, field graphql.CollectedField, obj *ObjectDirectives) (ret graphql.Marshaler) {
   292  	fc, err := ec.fieldContext_ObjectDirectives_order(ctx, field)
   293  	if err != nil {
   294  		return graphql.Null
   295  	}
   296  	ctx = graphql.WithFieldContext(ctx, fc)
   297  	defer func() {
   298  		if r := recover(); r != nil {
   299  			ec.Error(ctx, ec.Recover(ctx, r))
   300  			ret = graphql.Null
   301  		}
   302  	}()
   303  	resTmp := ec._fieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) {
   304  		ctx = rctx // use context from middleware stack in children
   305  		return obj.Order, nil
   306  	})
   307  
   308  	if resTmp == nil {
   309  		if !graphql.HasFieldError(ctx, fc) {
   310  			ec.Errorf(ctx, "must not be null")
   311  		}
   312  		return graphql.Null
   313  	}
   314  	res := resTmp.([]string)
   315  	fc.Result = res
   316  	return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res)
   317  }
   318  
   319  func (ec *executionContext) fieldContext_ObjectDirectives_order(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
   320  	fc = &graphql.FieldContext{
   321  		Object:     "ObjectDirectives",
   322  		Field:      field,
   323  		IsMethod:   false,
   324  		IsResolver: false,
   325  		Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
   326  			return nil, errors.New("field of type String does not have child fields")
   327  		},
   328  	}
   329  	return fc, nil
   330  }
   331  
   332  func (ec *executionContext) _ObjectDirectivesWithCustomGoModel_nullableText(ctx context.Context, field graphql.CollectedField, obj *ObjectDirectivesWithCustomGoModel) (ret graphql.Marshaler) {
   333  	fc, err := ec.fieldContext_ObjectDirectivesWithCustomGoModel_nullableText(ctx, field)
   334  	if err != nil {
   335  		return graphql.Null
   336  	}
   337  	ctx = graphql.WithFieldContext(ctx, fc)
   338  	defer func() {
   339  		if r := recover(); r != nil {
   340  			ec.Error(ctx, ec.Recover(ctx, r))
   341  			ret = graphql.Null
   342  		}
   343  	}()
   344  	resTmp := ec._fieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) {
   345  		directive0 := func(rctx context.Context) (interface{}, error) {
   346  			ctx = rctx // use context from middleware stack in children
   347  			return obj.NullableText, nil
   348  		}
   349  		directive1 := func(ctx context.Context) (interface{}, error) {
   350  			if ec.directives.ToNull == nil {
   351  				return nil, errors.New("directive toNull is not implemented")
   352  			}
   353  			return ec.directives.ToNull(ctx, obj, directive0)
   354  		}
   355  
   356  		tmp, err := directive1(rctx)
   357  		if err != nil {
   358  			return nil, graphql.ErrorOnPath(ctx, err)
   359  		}
   360  		if tmp == nil {
   361  			return nil, nil
   362  		}
   363  		if data, ok := tmp.(string); ok {
   364  			return data, nil
   365  		}
   366  		return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp)
   367  	})
   368  
   369  	if resTmp == nil {
   370  		return graphql.Null
   371  	}
   372  	res := resTmp.(string)
   373  	fc.Result = res
   374  	return ec.marshalOString2string(ctx, field.Selections, res)
   375  }
   376  
   377  func (ec *executionContext) fieldContext_ObjectDirectivesWithCustomGoModel_nullableText(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
   378  	fc = &graphql.FieldContext{
   379  		Object:     "ObjectDirectivesWithCustomGoModel",
   380  		Field:      field,
   381  		IsMethod:   false,
   382  		IsResolver: false,
   383  		Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
   384  			return nil, errors.New("field of type String does not have child fields")
   385  		},
   386  	}
   387  	return fc, nil
   388  }
   389  
   390  // endregion **************************** field.gotpl *****************************
   391  
   392  // region    **************************** input.gotpl *****************************
   393  
   394  func (ec *executionContext) unmarshalInputInnerDirectives(ctx context.Context, obj interface{}) (InnerDirectives, error) {
   395  	var it InnerDirectives
   396  	asMap := map[string]interface{}{}
   397  	for k, v := range obj.(map[string]interface{}) {
   398  		asMap[k] = v
   399  	}
   400  
   401  	fieldsInOrder := [...]string{"message"}
   402  	for _, k := range fieldsInOrder {
   403  		v, ok := asMap[k]
   404  		if !ok {
   405  			continue
   406  		}
   407  		switch k {
   408  		case "message":
   409  			var err error
   410  
   411  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("message"))
   412  			directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalNString2string(ctx, v) }
   413  			directive1 := func(ctx context.Context) (interface{}, error) {
   414  				min, err := ec.unmarshalNInt2int(ctx, 1)
   415  				if err != nil {
   416  					return nil, err
   417  				}
   418  				message, err := ec.unmarshalOString2ᚖstring(ctx, "not valid")
   419  				if err != nil {
   420  					return nil, err
   421  				}
   422  				if ec.directives.Length == nil {
   423  					return nil, errors.New("directive length is not implemented")
   424  				}
   425  				return ec.directives.Length(ctx, obj, directive0, min, nil, message)
   426  			}
   427  
   428  			tmp, err := directive1(ctx)
   429  			if err != nil {
   430  				return it, graphql.ErrorOnPath(ctx, err)
   431  			}
   432  			if data, ok := tmp.(string); ok {
   433  				it.Message = data
   434  			} else {
   435  				err := fmt.Errorf(`unexpected type %T from directive, should be string`, tmp)
   436  				return it, graphql.ErrorOnPath(ctx, err)
   437  			}
   438  		}
   439  	}
   440  
   441  	return it, nil
   442  }
   443  
   444  func (ec *executionContext) unmarshalInputInputDirectives(ctx context.Context, obj interface{}) (InputDirectives, error) {
   445  	var it InputDirectives
   446  	asMap := map[string]interface{}{}
   447  	for k, v := range obj.(map[string]interface{}) {
   448  		asMap[k] = v
   449  	}
   450  
   451  	fieldsInOrder := [...]string{"text", "nullableText", "inner", "innerNullable", "thirdParty"}
   452  	for _, k := range fieldsInOrder {
   453  		v, ok := asMap[k]
   454  		if !ok {
   455  			continue
   456  		}
   457  		switch k {
   458  		case "text":
   459  			var err error
   460  
   461  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text"))
   462  			directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalNString2string(ctx, v) }
   463  			directive1 := func(ctx context.Context) (interface{}, error) {
   464  				if ec.directives.Directive3 == nil {
   465  					return nil, errors.New("directive directive3 is not implemented")
   466  				}
   467  				return ec.directives.Directive3(ctx, obj, directive0)
   468  			}
   469  			directive2 := func(ctx context.Context) (interface{}, error) {
   470  				min, err := ec.unmarshalNInt2int(ctx, 0)
   471  				if err != nil {
   472  					return nil, err
   473  				}
   474  				max, err := ec.unmarshalOInt2ᚖint(ctx, 7)
   475  				if err != nil {
   476  					return nil, err
   477  				}
   478  				message, err := ec.unmarshalOString2ᚖstring(ctx, "not valid")
   479  				if err != nil {
   480  					return nil, err
   481  				}
   482  				if ec.directives.Length == nil {
   483  					return nil, errors.New("directive length is not implemented")
   484  				}
   485  				return ec.directives.Length(ctx, obj, directive1, min, max, message)
   486  			}
   487  
   488  			tmp, err := directive2(ctx)
   489  			if err != nil {
   490  				return it, graphql.ErrorOnPath(ctx, err)
   491  			}
   492  			if data, ok := tmp.(string); ok {
   493  				it.Text = data
   494  			} else {
   495  				err := fmt.Errorf(`unexpected type %T from directive, should be string`, tmp)
   496  				return it, graphql.ErrorOnPath(ctx, err)
   497  			}
   498  		case "nullableText":
   499  			var err error
   500  
   501  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nullableText"))
   502  			directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOString2ᚖstring(ctx, v) }
   503  			directive1 := func(ctx context.Context) (interface{}, error) {
   504  				if ec.directives.Directive3 == nil {
   505  					return nil, errors.New("directive directive3 is not implemented")
   506  				}
   507  				return ec.directives.Directive3(ctx, obj, directive0)
   508  			}
   509  			directive2 := func(ctx context.Context) (interface{}, error) {
   510  				if ec.directives.ToNull == nil {
   511  					return nil, errors.New("directive toNull is not implemented")
   512  				}
   513  				return ec.directives.ToNull(ctx, obj, directive1)
   514  			}
   515  
   516  			tmp, err := directive2(ctx)
   517  			if err != nil {
   518  				return it, graphql.ErrorOnPath(ctx, err)
   519  			}
   520  			if data, ok := tmp.(*string); ok {
   521  				it.NullableText = data
   522  			} else if tmp == nil {
   523  				it.NullableText = nil
   524  			} else {
   525  				err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp)
   526  				return it, graphql.ErrorOnPath(ctx, err)
   527  			}
   528  		case "inner":
   529  			var err error
   530  
   531  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("inner"))
   532  			directive0 := func(ctx context.Context) (interface{}, error) {
   533  				return ec.unmarshalNInnerDirectives2ᚖgithubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐInnerDirectives(ctx, v)
   534  			}
   535  			directive1 := func(ctx context.Context) (interface{}, error) {
   536  				if ec.directives.Directive3 == nil {
   537  					return nil, errors.New("directive directive3 is not implemented")
   538  				}
   539  				return ec.directives.Directive3(ctx, obj, directive0)
   540  			}
   541  
   542  			tmp, err := directive1(ctx)
   543  			if err != nil {
   544  				return it, graphql.ErrorOnPath(ctx, err)
   545  			}
   546  			if data, ok := tmp.(*InnerDirectives); ok {
   547  				it.Inner = data
   548  			} else if tmp == nil {
   549  				it.Inner = nil
   550  			} else {
   551  				err := fmt.Errorf(`unexpected type %T from directive, should be *github.com/geneva/gqlgen/codegen/testserver/followschema.InnerDirectives`, tmp)
   552  				return it, graphql.ErrorOnPath(ctx, err)
   553  			}
   554  		case "innerNullable":
   555  			var err error
   556  
   557  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("innerNullable"))
   558  			directive0 := func(ctx context.Context) (interface{}, error) {
   559  				return ec.unmarshalOInnerDirectives2ᚖgithubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐInnerDirectives(ctx, v)
   560  			}
   561  			directive1 := func(ctx context.Context) (interface{}, error) {
   562  				if ec.directives.Directive3 == nil {
   563  					return nil, errors.New("directive directive3 is not implemented")
   564  				}
   565  				return ec.directives.Directive3(ctx, obj, directive0)
   566  			}
   567  
   568  			tmp, err := directive1(ctx)
   569  			if err != nil {
   570  				return it, graphql.ErrorOnPath(ctx, err)
   571  			}
   572  			if data, ok := tmp.(*InnerDirectives); ok {
   573  				it.InnerNullable = data
   574  			} else if tmp == nil {
   575  				it.InnerNullable = nil
   576  			} else {
   577  				err := fmt.Errorf(`unexpected type %T from directive, should be *github.com/geneva/gqlgen/codegen/testserver/followschema.InnerDirectives`, tmp)
   578  				return it, graphql.ErrorOnPath(ctx, err)
   579  			}
   580  		case "thirdParty":
   581  			var err error
   582  
   583  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("thirdParty"))
   584  			directive0 := func(ctx context.Context) (interface{}, error) {
   585  				return ec.unmarshalOThirdParty2ᚖgithubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐThirdParty(ctx, v)
   586  			}
   587  			directive1 := func(ctx context.Context) (interface{}, error) {
   588  				if ec.directives.Directive3 == nil {
   589  					return nil, errors.New("directive directive3 is not implemented")
   590  				}
   591  				return ec.directives.Directive3(ctx, obj, directive0)
   592  			}
   593  			directive2 := func(ctx context.Context) (interface{}, error) {
   594  				min, err := ec.unmarshalNInt2int(ctx, 0)
   595  				if err != nil {
   596  					return nil, err
   597  				}
   598  				max, err := ec.unmarshalOInt2ᚖint(ctx, 7)
   599  				if err != nil {
   600  					return nil, err
   601  				}
   602  				if ec.directives.Length == nil {
   603  					return nil, errors.New("directive length is not implemented")
   604  				}
   605  				return ec.directives.Length(ctx, obj, directive1, min, max, nil)
   606  			}
   607  
   608  			tmp, err := directive2(ctx)
   609  			if err != nil {
   610  				return it, graphql.ErrorOnPath(ctx, err)
   611  			}
   612  			if data, ok := tmp.(*ThirdParty); ok {
   613  				it.ThirdParty = data
   614  			} else if tmp == nil {
   615  				it.ThirdParty = nil
   616  			} else {
   617  				err := fmt.Errorf(`unexpected type %T from directive, should be *github.com/geneva/gqlgen/codegen/testserver/followschema.ThirdParty`, tmp)
   618  				return it, graphql.ErrorOnPath(ctx, err)
   619  			}
   620  		}
   621  	}
   622  
   623  	return it, nil
   624  }
   625  
   626  // endregion **************************** input.gotpl *****************************
   627  
   628  // region    ************************** interface.gotpl ***************************
   629  
   630  // endregion ************************** interface.gotpl ***************************
   631  
   632  // region    **************************** object.gotpl ****************************
   633  
   634  var objectDirectivesImplementors = []string{"ObjectDirectives"}
   635  
   636  func (ec *executionContext) _ObjectDirectives(ctx context.Context, sel ast.SelectionSet, obj *ObjectDirectives) graphql.Marshaler {
   637  	fields := graphql.CollectFields(ec.OperationContext, sel, objectDirectivesImplementors)
   638  
   639  	out := graphql.NewFieldSet(fields)
   640  	deferred := make(map[string]*graphql.FieldSet)
   641  	for i, field := range fields {
   642  		switch field.Name {
   643  		case "__typename":
   644  			out.Values[i] = graphql.MarshalString("ObjectDirectives")
   645  		case "text":
   646  			out.Values[i] = ec._ObjectDirectives_text(ctx, field, obj)
   647  			if out.Values[i] == graphql.Null {
   648  				out.Invalids++
   649  			}
   650  		case "nullableText":
   651  			out.Values[i] = ec._ObjectDirectives_nullableText(ctx, field, obj)
   652  		case "order":
   653  			out.Values[i] = ec._ObjectDirectives_order(ctx, field, obj)
   654  			if out.Values[i] == graphql.Null {
   655  				out.Invalids++
   656  			}
   657  		default:
   658  			panic("unknown field " + strconv.Quote(field.Name))
   659  		}
   660  	}
   661  	out.Dispatch(ctx)
   662  	if out.Invalids > 0 {
   663  		return graphql.Null
   664  	}
   665  
   666  	atomic.AddInt32(&ec.deferred, int32(len(deferred)))
   667  
   668  	for label, dfs := range deferred {
   669  		ec.processDeferredGroup(graphql.DeferredGroup{
   670  			Label:    label,
   671  			Path:     graphql.GetPath(ctx),
   672  			FieldSet: dfs,
   673  			Context:  ctx,
   674  		})
   675  	}
   676  
   677  	return out
   678  }
   679  
   680  var objectDirectivesWithCustomGoModelImplementors = []string{"ObjectDirectivesWithCustomGoModel"}
   681  
   682  func (ec *executionContext) _ObjectDirectivesWithCustomGoModel(ctx context.Context, sel ast.SelectionSet, obj *ObjectDirectivesWithCustomGoModel) graphql.Marshaler {
   683  	fields := graphql.CollectFields(ec.OperationContext, sel, objectDirectivesWithCustomGoModelImplementors)
   684  
   685  	out := graphql.NewFieldSet(fields)
   686  	deferred := make(map[string]*graphql.FieldSet)
   687  	for i, field := range fields {
   688  		switch field.Name {
   689  		case "__typename":
   690  			out.Values[i] = graphql.MarshalString("ObjectDirectivesWithCustomGoModel")
   691  		case "nullableText":
   692  			out.Values[i] = ec._ObjectDirectivesWithCustomGoModel_nullableText(ctx, field, obj)
   693  		default:
   694  			panic("unknown field " + strconv.Quote(field.Name))
   695  		}
   696  	}
   697  	out.Dispatch(ctx)
   698  	if out.Invalids > 0 {
   699  		return graphql.Null
   700  	}
   701  
   702  	atomic.AddInt32(&ec.deferred, int32(len(deferred)))
   703  
   704  	for label, dfs := range deferred {
   705  		ec.processDeferredGroup(graphql.DeferredGroup{
   706  			Label:    label,
   707  			Path:     graphql.GetPath(ctx),
   708  			FieldSet: dfs,
   709  			Context:  ctx,
   710  		})
   711  	}
   712  
   713  	return out
   714  }
   715  
   716  // endregion **************************** object.gotpl ****************************
   717  
   718  // region    ***************************** type.gotpl *****************************
   719  
   720  func (ec *executionContext) unmarshalNInnerDirectives2ᚖgithubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐInnerDirectives(ctx context.Context, v interface{}) (*InnerDirectives, error) {
   721  	res, err := ec.unmarshalInputInnerDirectives(ctx, v)
   722  	return &res, graphql.ErrorOnPath(ctx, err)
   723  }
   724  
   725  func (ec *executionContext) unmarshalNInputDirectives2githubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐInputDirectives(ctx context.Context, v interface{}) (InputDirectives, error) {
   726  	res, err := ec.unmarshalInputInputDirectives(ctx, v)
   727  	return res, graphql.ErrorOnPath(ctx, err)
   728  }
   729  
   730  func (ec *executionContext) unmarshalOInnerDirectives2ᚖgithubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐInnerDirectives(ctx context.Context, v interface{}) (*InnerDirectives, error) {
   731  	if v == nil {
   732  		return nil, nil
   733  	}
   734  	res, err := ec.unmarshalInputInnerDirectives(ctx, v)
   735  	return &res, graphql.ErrorOnPath(ctx, err)
   736  }
   737  
   738  func (ec *executionContext) unmarshalOInputDirectives2ᚖgithubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐInputDirectives(ctx context.Context, v interface{}) (*InputDirectives, error) {
   739  	if v == nil {
   740  		return nil, nil
   741  	}
   742  	res, err := ec.unmarshalInputInputDirectives(ctx, v)
   743  	return &res, graphql.ErrorOnPath(ctx, err)
   744  }
   745  
   746  func (ec *executionContext) marshalOObjectDirectives2ᚖgithubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐObjectDirectives(ctx context.Context, sel ast.SelectionSet, v *ObjectDirectives) graphql.Marshaler {
   747  	if v == nil {
   748  		return graphql.Null
   749  	}
   750  	return ec._ObjectDirectives(ctx, sel, v)
   751  }
   752  
   753  func (ec *executionContext) marshalOObjectDirectivesWithCustomGoModel2ᚖgithubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐObjectDirectivesWithCustomGoModel(ctx context.Context, sel ast.SelectionSet, v *ObjectDirectivesWithCustomGoModel) graphql.Marshaler {
   754  	if v == nil {
   755  		return graphql.Null
   756  	}
   757  	return ec._ObjectDirectivesWithCustomGoModel(ctx, sel, v)
   758  }
   759  
   760  // endregion ***************************** type.gotpl *****************************