github.com/senomas/gqlgen@v0.17.11-0.20220626120754-9aee61b0716a/codegen/testserver/followschema/directive.generated.go (about)

     1  // Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
     2  
     3  package followschema
     4  
     5  import (
     6  	"context"
     7  	"errors"
     8  	"fmt"
     9  	"strconv"
    10  
    11  	"github.com/99designs/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  	for k, v := range asMap {
   401  		switch k {
   402  		case "message":
   403  			var err error
   404  
   405  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("message"))
   406  			directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalNString2string(ctx, v) }
   407  			directive1 := func(ctx context.Context) (interface{}, error) {
   408  				min, err := ec.unmarshalNInt2int(ctx, 1)
   409  				if err != nil {
   410  					return nil, err
   411  				}
   412  				message, err := ec.unmarshalOString2ᚖstring(ctx, "not valid")
   413  				if err != nil {
   414  					return nil, err
   415  				}
   416  				if ec.directives.Length == nil {
   417  					return nil, errors.New("directive length is not implemented")
   418  				}
   419  				return ec.directives.Length(ctx, obj, directive0, min, nil, message)
   420  			}
   421  
   422  			tmp, err := directive1(ctx)
   423  			if err != nil {
   424  				return it, graphql.ErrorOnPath(ctx, err)
   425  			}
   426  			if data, ok := tmp.(string); ok {
   427  				it.Message = data
   428  			} else {
   429  				err := fmt.Errorf(`unexpected type %T from directive, should be string`, tmp)
   430  				return it, graphql.ErrorOnPath(ctx, err)
   431  			}
   432  		}
   433  	}
   434  
   435  	return it, nil
   436  }
   437  
   438  func (ec *executionContext) unmarshalInputInputDirectives(ctx context.Context, obj interface{}) (InputDirectives, error) {
   439  	var it InputDirectives
   440  	asMap := map[string]interface{}{}
   441  	for k, v := range obj.(map[string]interface{}) {
   442  		asMap[k] = v
   443  	}
   444  
   445  	for k, v := range asMap {
   446  		switch k {
   447  		case "text":
   448  			var err error
   449  
   450  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text"))
   451  			directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalNString2string(ctx, v) }
   452  			directive1 := func(ctx context.Context) (interface{}, error) {
   453  				if ec.directives.Directive3 == nil {
   454  					return nil, errors.New("directive directive3 is not implemented")
   455  				}
   456  				return ec.directives.Directive3(ctx, obj, directive0)
   457  			}
   458  			directive2 := func(ctx context.Context) (interface{}, error) {
   459  				min, err := ec.unmarshalNInt2int(ctx, 0)
   460  				if err != nil {
   461  					return nil, err
   462  				}
   463  				max, err := ec.unmarshalOInt2ᚖint(ctx, 7)
   464  				if err != nil {
   465  					return nil, err
   466  				}
   467  				message, err := ec.unmarshalOString2ᚖstring(ctx, "not valid")
   468  				if err != nil {
   469  					return nil, err
   470  				}
   471  				if ec.directives.Length == nil {
   472  					return nil, errors.New("directive length is not implemented")
   473  				}
   474  				return ec.directives.Length(ctx, obj, directive1, min, max, message)
   475  			}
   476  
   477  			tmp, err := directive2(ctx)
   478  			if err != nil {
   479  				return it, graphql.ErrorOnPath(ctx, err)
   480  			}
   481  			if data, ok := tmp.(string); ok {
   482  				it.Text = data
   483  			} else {
   484  				err := fmt.Errorf(`unexpected type %T from directive, should be string`, tmp)
   485  				return it, graphql.ErrorOnPath(ctx, err)
   486  			}
   487  		case "nullableText":
   488  			var err error
   489  
   490  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nullableText"))
   491  			directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOString2ᚖstring(ctx, v) }
   492  			directive1 := func(ctx context.Context) (interface{}, error) {
   493  				if ec.directives.Directive3 == nil {
   494  					return nil, errors.New("directive directive3 is not implemented")
   495  				}
   496  				return ec.directives.Directive3(ctx, obj, directive0)
   497  			}
   498  			directive2 := func(ctx context.Context) (interface{}, error) {
   499  				if ec.directives.ToNull == nil {
   500  					return nil, errors.New("directive toNull is not implemented")
   501  				}
   502  				return ec.directives.ToNull(ctx, obj, directive1)
   503  			}
   504  
   505  			tmp, err := directive2(ctx)
   506  			if err != nil {
   507  				return it, graphql.ErrorOnPath(ctx, err)
   508  			}
   509  			if data, ok := tmp.(*string); ok {
   510  				it.NullableText = data
   511  			} else if tmp == nil {
   512  				it.NullableText = nil
   513  			} else {
   514  				err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp)
   515  				return it, graphql.ErrorOnPath(ctx, err)
   516  			}
   517  		case "inner":
   518  			var err error
   519  
   520  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("inner"))
   521  			directive0 := func(ctx context.Context) (interface{}, error) {
   522  				return ec.unmarshalNInnerDirectives2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐInnerDirectives(ctx, v)
   523  			}
   524  			directive1 := func(ctx context.Context) (interface{}, error) {
   525  				if ec.directives.Directive3 == nil {
   526  					return nil, errors.New("directive directive3 is not implemented")
   527  				}
   528  				return ec.directives.Directive3(ctx, obj, directive0)
   529  			}
   530  
   531  			tmp, err := directive1(ctx)
   532  			if err != nil {
   533  				return it, graphql.ErrorOnPath(ctx, err)
   534  			}
   535  			if data, ok := tmp.(*InnerDirectives); ok {
   536  				it.Inner = data
   537  			} else if tmp == nil {
   538  				it.Inner = nil
   539  			} else {
   540  				err := fmt.Errorf(`unexpected type %T from directive, should be *github.com/99designs/gqlgen/codegen/testserver/followschema.InnerDirectives`, tmp)
   541  				return it, graphql.ErrorOnPath(ctx, err)
   542  			}
   543  		case "innerNullable":
   544  			var err error
   545  
   546  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("innerNullable"))
   547  			directive0 := func(ctx context.Context) (interface{}, error) {
   548  				return ec.unmarshalOInnerDirectives2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐInnerDirectives(ctx, v)
   549  			}
   550  			directive1 := func(ctx context.Context) (interface{}, error) {
   551  				if ec.directives.Directive3 == nil {
   552  					return nil, errors.New("directive directive3 is not implemented")
   553  				}
   554  				return ec.directives.Directive3(ctx, obj, directive0)
   555  			}
   556  
   557  			tmp, err := directive1(ctx)
   558  			if err != nil {
   559  				return it, graphql.ErrorOnPath(ctx, err)
   560  			}
   561  			if data, ok := tmp.(*InnerDirectives); ok {
   562  				it.InnerNullable = data
   563  			} else if tmp == nil {
   564  				it.InnerNullable = nil
   565  			} else {
   566  				err := fmt.Errorf(`unexpected type %T from directive, should be *github.com/99designs/gqlgen/codegen/testserver/followschema.InnerDirectives`, tmp)
   567  				return it, graphql.ErrorOnPath(ctx, err)
   568  			}
   569  		case "thirdParty":
   570  			var err error
   571  
   572  			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("thirdParty"))
   573  			directive0 := func(ctx context.Context) (interface{}, error) {
   574  				return ec.unmarshalOThirdParty2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐThirdParty(ctx, v)
   575  			}
   576  			directive1 := func(ctx context.Context) (interface{}, error) {
   577  				if ec.directives.Directive3 == nil {
   578  					return nil, errors.New("directive directive3 is not implemented")
   579  				}
   580  				return ec.directives.Directive3(ctx, obj, directive0)
   581  			}
   582  			directive2 := func(ctx context.Context) (interface{}, error) {
   583  				min, err := ec.unmarshalNInt2int(ctx, 0)
   584  				if err != nil {
   585  					return nil, err
   586  				}
   587  				max, err := ec.unmarshalOInt2ᚖint(ctx, 7)
   588  				if err != nil {
   589  					return nil, err
   590  				}
   591  				if ec.directives.Length == nil {
   592  					return nil, errors.New("directive length is not implemented")
   593  				}
   594  				return ec.directives.Length(ctx, obj, directive1, min, max, nil)
   595  			}
   596  
   597  			tmp, err := directive2(ctx)
   598  			if err != nil {
   599  				return it, graphql.ErrorOnPath(ctx, err)
   600  			}
   601  			if data, ok := tmp.(*ThirdParty); ok {
   602  				it.ThirdParty = data
   603  			} else if tmp == nil {
   604  				it.ThirdParty = nil
   605  			} else {
   606  				err := fmt.Errorf(`unexpected type %T from directive, should be *github.com/99designs/gqlgen/codegen/testserver/followschema.ThirdParty`, tmp)
   607  				return it, graphql.ErrorOnPath(ctx, err)
   608  			}
   609  		}
   610  	}
   611  
   612  	return it, nil
   613  }
   614  
   615  // endregion **************************** input.gotpl *****************************
   616  
   617  // region    ************************** interface.gotpl ***************************
   618  
   619  // endregion ************************** interface.gotpl ***************************
   620  
   621  // region    **************************** object.gotpl ****************************
   622  
   623  var objectDirectivesImplementors = []string{"ObjectDirectives"}
   624  
   625  func (ec *executionContext) _ObjectDirectives(ctx context.Context, sel ast.SelectionSet, obj *ObjectDirectives) graphql.Marshaler {
   626  	fields := graphql.CollectFields(ec.OperationContext, sel, objectDirectivesImplementors)
   627  	out := graphql.NewFieldSet(fields)
   628  	var invalids uint32
   629  	for i, field := range fields {
   630  		switch field.Name {
   631  		case "__typename":
   632  			out.Values[i] = graphql.MarshalString("ObjectDirectives")
   633  		case "text":
   634  
   635  			out.Values[i] = ec._ObjectDirectives_text(ctx, field, obj)
   636  
   637  			if out.Values[i] == graphql.Null {
   638  				invalids++
   639  			}
   640  		case "nullableText":
   641  
   642  			out.Values[i] = ec._ObjectDirectives_nullableText(ctx, field, obj)
   643  
   644  		case "order":
   645  
   646  			out.Values[i] = ec._ObjectDirectives_order(ctx, field, obj)
   647  
   648  			if out.Values[i] == graphql.Null {
   649  				invalids++
   650  			}
   651  		default:
   652  			panic("unknown field " + strconv.Quote(field.Name))
   653  		}
   654  	}
   655  	out.Dispatch()
   656  	if invalids > 0 {
   657  		return graphql.Null
   658  	}
   659  	return out
   660  }
   661  
   662  var objectDirectivesWithCustomGoModelImplementors = []string{"ObjectDirectivesWithCustomGoModel"}
   663  
   664  func (ec *executionContext) _ObjectDirectivesWithCustomGoModel(ctx context.Context, sel ast.SelectionSet, obj *ObjectDirectivesWithCustomGoModel) graphql.Marshaler {
   665  	fields := graphql.CollectFields(ec.OperationContext, sel, objectDirectivesWithCustomGoModelImplementors)
   666  	out := graphql.NewFieldSet(fields)
   667  	var invalids uint32
   668  	for i, field := range fields {
   669  		switch field.Name {
   670  		case "__typename":
   671  			out.Values[i] = graphql.MarshalString("ObjectDirectivesWithCustomGoModel")
   672  		case "nullableText":
   673  
   674  			out.Values[i] = ec._ObjectDirectivesWithCustomGoModel_nullableText(ctx, field, obj)
   675  
   676  		default:
   677  			panic("unknown field " + strconv.Quote(field.Name))
   678  		}
   679  	}
   680  	out.Dispatch()
   681  	if invalids > 0 {
   682  		return graphql.Null
   683  	}
   684  	return out
   685  }
   686  
   687  // endregion **************************** object.gotpl ****************************
   688  
   689  // region    ***************************** type.gotpl *****************************
   690  
   691  func (ec *executionContext) unmarshalNInnerDirectives2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐInnerDirectives(ctx context.Context, v interface{}) (*InnerDirectives, error) {
   692  	res, err := ec.unmarshalInputInnerDirectives(ctx, v)
   693  	return &res, graphql.ErrorOnPath(ctx, err)
   694  }
   695  
   696  func (ec *executionContext) unmarshalNInputDirectives2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐInputDirectives(ctx context.Context, v interface{}) (InputDirectives, error) {
   697  	res, err := ec.unmarshalInputInputDirectives(ctx, v)
   698  	return res, graphql.ErrorOnPath(ctx, err)
   699  }
   700  
   701  func (ec *executionContext) unmarshalOInnerDirectives2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐInnerDirectives(ctx context.Context, v interface{}) (*InnerDirectives, error) {
   702  	if v == nil {
   703  		return nil, nil
   704  	}
   705  	res, err := ec.unmarshalInputInnerDirectives(ctx, v)
   706  	return &res, graphql.ErrorOnPath(ctx, err)
   707  }
   708  
   709  func (ec *executionContext) unmarshalOInputDirectives2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐInputDirectives(ctx context.Context, v interface{}) (*InputDirectives, error) {
   710  	if v == nil {
   711  		return nil, nil
   712  	}
   713  	res, err := ec.unmarshalInputInputDirectives(ctx, v)
   714  	return &res, graphql.ErrorOnPath(ctx, err)
   715  }
   716  
   717  func (ec *executionContext) marshalOObjectDirectives2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐObjectDirectives(ctx context.Context, sel ast.SelectionSet, v *ObjectDirectives) graphql.Marshaler {
   718  	if v == nil {
   719  		return graphql.Null
   720  	}
   721  	return ec._ObjectDirectives(ctx, sel, v)
   722  }
   723  
   724  func (ec *executionContext) marshalOObjectDirectivesWithCustomGoModel2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐObjectDirectivesWithCustomGoModel(ctx context.Context, sel ast.SelectionSet, v *ObjectDirectivesWithCustomGoModel) graphql.Marshaler {
   725  	if v == nil {
   726  		return graphql.Null
   727  	}
   728  	return ec._ObjectDirectivesWithCustomGoModel(ctx, sel, v)
   729  }
   730  
   731  // endregion ***************************** type.gotpl *****************************