github.com/luciferinlove/gqlgen@v0.17.16-bzc.1/codegen/testserver/followschema/directive.generated.go (about)

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