github.com/fortexxx/gqlgen@v0.10.3-0.20191216030626-ca5ea8b21ead/example/chat/generated.go (about)

     1  // Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
     2  
     3  package chat
     4  
     5  import (
     6  	"bytes"
     7  	"context"
     8  	"errors"
     9  	"io"
    10  	"strconv"
    11  	"sync"
    12  	"time"
    13  
    14  	"github.com/99designs/gqlgen/graphql"
    15  	"github.com/99designs/gqlgen/graphql/introspection"
    16  	"github.com/vektah/gqlparser"
    17  	"github.com/vektah/gqlparser/ast"
    18  )
    19  
    20  // region    ************************** generated!.gotpl **************************
    21  
    22  // NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
    23  func NewExecutableSchema(cfg Config) graphql.ExecutableSchema {
    24  	return &executableSchema{
    25  		resolvers:  cfg.Resolvers,
    26  		directives: cfg.Directives,
    27  		complexity: cfg.Complexity,
    28  	}
    29  }
    30  
    31  type Config struct {
    32  	Resolvers  ResolverRoot
    33  	Directives DirectiveRoot
    34  	Complexity ComplexityRoot
    35  }
    36  
    37  type ResolverRoot interface {
    38  	Mutation() MutationResolver
    39  	Query() QueryResolver
    40  	Subscription() SubscriptionResolver
    41  }
    42  
    43  type DirectiveRoot struct {
    44  	User func(ctx context.Context, obj interface{}, next graphql.Resolver, username string) (res interface{}, err error)
    45  }
    46  
    47  type ComplexityRoot struct {
    48  	Chatroom struct {
    49  		Messages func(childComplexity int) int
    50  		Name     func(childComplexity int) int
    51  	}
    52  
    53  	Message struct {
    54  		CreatedAt func(childComplexity int) int
    55  		CreatedBy func(childComplexity int) int
    56  		ID        func(childComplexity int) int
    57  		Text      func(childComplexity int) int
    58  	}
    59  
    60  	Mutation struct {
    61  		Post func(childComplexity int, text string, username string, roomName string) int
    62  	}
    63  
    64  	Query struct {
    65  		Room func(childComplexity int, name string) int
    66  	}
    67  
    68  	Subscription struct {
    69  		MessageAdded func(childComplexity int, roomName string) int
    70  	}
    71  }
    72  
    73  type MutationResolver interface {
    74  	Post(ctx context.Context, text string, username string, roomName string) (*Message, error)
    75  }
    76  type QueryResolver interface {
    77  	Room(ctx context.Context, name string) (*Chatroom, error)
    78  }
    79  type SubscriptionResolver interface {
    80  	MessageAdded(ctx context.Context, roomName string) (<-chan *Message, error)
    81  }
    82  
    83  type executableSchema struct {
    84  	resolvers  ResolverRoot
    85  	directives DirectiveRoot
    86  	complexity ComplexityRoot
    87  }
    88  
    89  func (e *executableSchema) Schema() *ast.Schema {
    90  	return parsedSchema
    91  }
    92  
    93  func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) {
    94  	ec := executionContext{nil, e}
    95  	_ = ec
    96  	switch typeName + "." + field {
    97  
    98  	case "Chatroom.messages":
    99  		if e.complexity.Chatroom.Messages == nil {
   100  			break
   101  		}
   102  
   103  		return e.complexity.Chatroom.Messages(childComplexity), true
   104  
   105  	case "Chatroom.name":
   106  		if e.complexity.Chatroom.Name == nil {
   107  			break
   108  		}
   109  
   110  		return e.complexity.Chatroom.Name(childComplexity), true
   111  
   112  	case "Message.createdAt":
   113  		if e.complexity.Message.CreatedAt == nil {
   114  			break
   115  		}
   116  
   117  		return e.complexity.Message.CreatedAt(childComplexity), true
   118  
   119  	case "Message.createdBy":
   120  		if e.complexity.Message.CreatedBy == nil {
   121  			break
   122  		}
   123  
   124  		return e.complexity.Message.CreatedBy(childComplexity), true
   125  
   126  	case "Message.id":
   127  		if e.complexity.Message.ID == nil {
   128  			break
   129  		}
   130  
   131  		return e.complexity.Message.ID(childComplexity), true
   132  
   133  	case "Message.text":
   134  		if e.complexity.Message.Text == nil {
   135  			break
   136  		}
   137  
   138  		return e.complexity.Message.Text(childComplexity), true
   139  
   140  	case "Mutation.post":
   141  		if e.complexity.Mutation.Post == nil {
   142  			break
   143  		}
   144  
   145  		args, err := ec.field_Mutation_post_args(context.TODO(), rawArgs)
   146  		if err != nil {
   147  			return 0, false
   148  		}
   149  
   150  		return e.complexity.Mutation.Post(childComplexity, args["text"].(string), args["username"].(string), args["roomName"].(string)), true
   151  
   152  	case "Query.room":
   153  		if e.complexity.Query.Room == nil {
   154  			break
   155  		}
   156  
   157  		args, err := ec.field_Query_room_args(context.TODO(), rawArgs)
   158  		if err != nil {
   159  			return 0, false
   160  		}
   161  
   162  		return e.complexity.Query.Room(childComplexity, args["name"].(string)), true
   163  
   164  	case "Subscription.messageAdded":
   165  		if e.complexity.Subscription.MessageAdded == nil {
   166  			break
   167  		}
   168  
   169  		args, err := ec.field_Subscription_messageAdded_args(context.TODO(), rawArgs)
   170  		if err != nil {
   171  			return 0, false
   172  		}
   173  
   174  		return e.complexity.Subscription.MessageAdded(childComplexity, args["roomName"].(string)), true
   175  
   176  	}
   177  	return 0, false
   178  }
   179  
   180  func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler {
   181  	rc := graphql.GetOperationContext(ctx)
   182  	ec := executionContext{rc, e}
   183  	first := true
   184  
   185  	switch rc.Operation.Operation {
   186  	case ast.Query:
   187  		return func(ctx context.Context) *graphql.Response {
   188  			if !first {
   189  				return nil
   190  			}
   191  			first = false
   192  			data := ec._Query(ctx, rc.Operation.SelectionSet)
   193  			var buf bytes.Buffer
   194  			data.MarshalGQL(&buf)
   195  
   196  			return &graphql.Response{
   197  				Data: buf.Bytes(),
   198  			}
   199  		}
   200  	case ast.Mutation:
   201  		return func(ctx context.Context) *graphql.Response {
   202  			if !first {
   203  				return nil
   204  			}
   205  			first = false
   206  			data := ec._Mutation(ctx, rc.Operation.SelectionSet)
   207  			var buf bytes.Buffer
   208  			data.MarshalGQL(&buf)
   209  
   210  			return &graphql.Response{
   211  				Data: buf.Bytes(),
   212  			}
   213  		}
   214  	case ast.Subscription:
   215  		next := ec._subscriptionMiddleware(ctx, rc.Operation, func(ctx context.Context) (interface{}, error) {
   216  			return ec._Subscription(ctx, rc.Operation.SelectionSet), nil
   217  		})
   218  
   219  		var buf bytes.Buffer
   220  		return func(ctx context.Context) *graphql.Response {
   221  			buf.Reset()
   222  			data := next()
   223  
   224  			if data == nil {
   225  				return nil
   226  			}
   227  			data.MarshalGQL(&buf)
   228  
   229  			return &graphql.Response{
   230  				Data: buf.Bytes(),
   231  			}
   232  		}
   233  
   234  	default:
   235  		return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation"))
   236  	}
   237  }
   238  
   239  type executionContext struct {
   240  	*graphql.OperationContext
   241  	*executableSchema
   242  }
   243  
   244  func (ec *executionContext) introspectSchema() (*introspection.Schema, error) {
   245  	if ec.DisableIntrospection {
   246  		return nil, errors.New("introspection disabled")
   247  	}
   248  	return introspection.WrapSchema(parsedSchema), nil
   249  }
   250  
   251  func (ec *executionContext) introspectType(name string) (*introspection.Type, error) {
   252  	if ec.DisableIntrospection {
   253  		return nil, errors.New("introspection disabled")
   254  	}
   255  	return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil
   256  }
   257  
   258  var parsedSchema = gqlparser.MustLoadSchema(
   259  	&ast.Source{Name: "schema.graphql", Input: `type Chatroom {
   260      name: String!
   261      messages: [Message!]!
   262  }
   263  
   264  type Message {
   265      id: ID!
   266      text: String!
   267      createdBy: String!
   268      createdAt: Time!
   269  }
   270  
   271  type Query {
   272      room(name:String!): Chatroom
   273  }
   274  
   275  type Mutation {
   276      post(text: String!, username: String!, roomName: String!): Message!
   277  }
   278  
   279  type Subscription {
   280      messageAdded(roomName: String!): Message!
   281  }
   282  
   283  scalar Time
   284  
   285  directive @user(username: String!) on SUBSCRIPTION
   286  `},
   287  )
   288  
   289  // endregion ************************** generated!.gotpl **************************
   290  
   291  // region    ***************************** args.gotpl *****************************
   292  
   293  func (ec *executionContext) dir_user_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
   294  	var err error
   295  	args := map[string]interface{}{}
   296  	var arg0 string
   297  	if tmp, ok := rawArgs["username"]; ok {
   298  		arg0, err = ec.unmarshalNString2string(ctx, tmp)
   299  		if err != nil {
   300  			return nil, err
   301  		}
   302  	}
   303  	args["username"] = arg0
   304  	return args, nil
   305  }
   306  
   307  func (ec *executionContext) field_Mutation_post_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
   308  	var err error
   309  	args := map[string]interface{}{}
   310  	var arg0 string
   311  	if tmp, ok := rawArgs["text"]; ok {
   312  		arg0, err = ec.unmarshalNString2string(ctx, tmp)
   313  		if err != nil {
   314  			return nil, err
   315  		}
   316  	}
   317  	args["text"] = arg0
   318  	var arg1 string
   319  	if tmp, ok := rawArgs["username"]; ok {
   320  		arg1, err = ec.unmarshalNString2string(ctx, tmp)
   321  		if err != nil {
   322  			return nil, err
   323  		}
   324  	}
   325  	args["username"] = arg1
   326  	var arg2 string
   327  	if tmp, ok := rawArgs["roomName"]; ok {
   328  		arg2, err = ec.unmarshalNString2string(ctx, tmp)
   329  		if err != nil {
   330  			return nil, err
   331  		}
   332  	}
   333  	args["roomName"] = arg2
   334  	return args, nil
   335  }
   336  
   337  func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
   338  	var err error
   339  	args := map[string]interface{}{}
   340  	var arg0 string
   341  	if tmp, ok := rawArgs["name"]; ok {
   342  		arg0, err = ec.unmarshalNString2string(ctx, tmp)
   343  		if err != nil {
   344  			return nil, err
   345  		}
   346  	}
   347  	args["name"] = arg0
   348  	return args, nil
   349  }
   350  
   351  func (ec *executionContext) field_Query_room_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
   352  	var err error
   353  	args := map[string]interface{}{}
   354  	var arg0 string
   355  	if tmp, ok := rawArgs["name"]; ok {
   356  		arg0, err = ec.unmarshalNString2string(ctx, tmp)
   357  		if err != nil {
   358  			return nil, err
   359  		}
   360  	}
   361  	args["name"] = arg0
   362  	return args, nil
   363  }
   364  
   365  func (ec *executionContext) field_Subscription_messageAdded_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
   366  	var err error
   367  	args := map[string]interface{}{}
   368  	var arg0 string
   369  	if tmp, ok := rawArgs["roomName"]; ok {
   370  		arg0, err = ec.unmarshalNString2string(ctx, tmp)
   371  		if err != nil {
   372  			return nil, err
   373  		}
   374  	}
   375  	args["roomName"] = arg0
   376  	return args, nil
   377  }
   378  
   379  func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
   380  	var err error
   381  	args := map[string]interface{}{}
   382  	var arg0 bool
   383  	if tmp, ok := rawArgs["includeDeprecated"]; ok {
   384  		arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp)
   385  		if err != nil {
   386  			return nil, err
   387  		}
   388  	}
   389  	args["includeDeprecated"] = arg0
   390  	return args, nil
   391  }
   392  
   393  func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
   394  	var err error
   395  	args := map[string]interface{}{}
   396  	var arg0 bool
   397  	if tmp, ok := rawArgs["includeDeprecated"]; ok {
   398  		arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp)
   399  		if err != nil {
   400  			return nil, err
   401  		}
   402  	}
   403  	args["includeDeprecated"] = arg0
   404  	return args, nil
   405  }
   406  
   407  // endregion ***************************** args.gotpl *****************************
   408  
   409  // region    ************************** directives.gotpl **************************
   410  
   411  func (ec *executionContext) _subscriptionMiddleware(ctx context.Context, obj *ast.OperationDefinition, next func(ctx context.Context) (interface{}, error)) func() graphql.Marshaler {
   412  	for _, d := range obj.Directives {
   413  		switch d.Name {
   414  		case "user":
   415  			rawArgs := d.ArgumentMap(ec.Variables)
   416  			args, err := ec.dir_user_args(ctx, rawArgs)
   417  			if err != nil {
   418  				ec.Error(ctx, err)
   419  				return func() graphql.Marshaler {
   420  					return graphql.Null
   421  				}
   422  			}
   423  			n := next
   424  			next = func(ctx context.Context) (interface{}, error) {
   425  				if ec.directives.User == nil {
   426  					return nil, errors.New("directive user is not implemented")
   427  				}
   428  				return ec.directives.User(ctx, obj, n, args["username"].(string))
   429  			}
   430  		}
   431  	}
   432  	tmp, err := next(ctx)
   433  	if err != nil {
   434  		ec.Error(ctx, err)
   435  		return func() graphql.Marshaler {
   436  			return graphql.Null
   437  		}
   438  	}
   439  	if data, ok := tmp.(func() graphql.Marshaler); ok {
   440  		return data
   441  	}
   442  	ec.Errorf(ctx, `unexpected type %T from directive, should be graphql.Marshaler`, tmp)
   443  	return func() graphql.Marshaler {
   444  		return graphql.Null
   445  	}
   446  }
   447  
   448  // endregion ************************** directives.gotpl **************************
   449  
   450  // region    **************************** field.gotpl *****************************
   451  
   452  func (ec *executionContext) _Chatroom_name(ctx context.Context, field graphql.CollectedField, obj *Chatroom) (ret graphql.Marshaler) {
   453  	defer func() {
   454  		if r := recover(); r != nil {
   455  			ec.Error(ctx, ec.Recover(ctx, r))
   456  			ret = graphql.Null
   457  		}
   458  	}()
   459  	fc := &graphql.FieldContext{
   460  		Object:   "Chatroom",
   461  		Field:    field,
   462  		Args:     nil,
   463  		IsMethod: false,
   464  	}
   465  
   466  	ctx = graphql.WithFieldContext(ctx, fc)
   467  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   468  		ctx = rctx // use context from middleware stack in children
   469  		return obj.Name, nil
   470  	})
   471  	if err != nil {
   472  		ec.Error(ctx, err)
   473  		return graphql.Null
   474  	}
   475  	if resTmp == nil {
   476  		if !graphql.HasFieldError(ctx, fc) {
   477  			ec.Errorf(ctx, "must not be null")
   478  		}
   479  		return graphql.Null
   480  	}
   481  	res := resTmp.(string)
   482  	fc.Result = res
   483  	return ec.marshalNString2string(ctx, field.Selections, res)
   484  }
   485  
   486  func (ec *executionContext) _Chatroom_messages(ctx context.Context, field graphql.CollectedField, obj *Chatroom) (ret graphql.Marshaler) {
   487  	defer func() {
   488  		if r := recover(); r != nil {
   489  			ec.Error(ctx, ec.Recover(ctx, r))
   490  			ret = graphql.Null
   491  		}
   492  	}()
   493  	fc := &graphql.FieldContext{
   494  		Object:   "Chatroom",
   495  		Field:    field,
   496  		Args:     nil,
   497  		IsMethod: false,
   498  	}
   499  
   500  	ctx = graphql.WithFieldContext(ctx, fc)
   501  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   502  		ctx = rctx // use context from middleware stack in children
   503  		return obj.Messages, nil
   504  	})
   505  	if err != nil {
   506  		ec.Error(ctx, err)
   507  		return graphql.Null
   508  	}
   509  	if resTmp == nil {
   510  		if !graphql.HasFieldError(ctx, fc) {
   511  			ec.Errorf(ctx, "must not be null")
   512  		}
   513  		return graphql.Null
   514  	}
   515  	res := resTmp.([]Message)
   516  	fc.Result = res
   517  	return ec.marshalNMessage2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋchatᚐMessageᚄ(ctx, field.Selections, res)
   518  }
   519  
   520  func (ec *executionContext) _Message_id(ctx context.Context, field graphql.CollectedField, obj *Message) (ret graphql.Marshaler) {
   521  	defer func() {
   522  		if r := recover(); r != nil {
   523  			ec.Error(ctx, ec.Recover(ctx, r))
   524  			ret = graphql.Null
   525  		}
   526  	}()
   527  	fc := &graphql.FieldContext{
   528  		Object:   "Message",
   529  		Field:    field,
   530  		Args:     nil,
   531  		IsMethod: false,
   532  	}
   533  
   534  	ctx = graphql.WithFieldContext(ctx, fc)
   535  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   536  		ctx = rctx // use context from middleware stack in children
   537  		return obj.ID, nil
   538  	})
   539  	if err != nil {
   540  		ec.Error(ctx, err)
   541  		return graphql.Null
   542  	}
   543  	if resTmp == nil {
   544  		if !graphql.HasFieldError(ctx, fc) {
   545  			ec.Errorf(ctx, "must not be null")
   546  		}
   547  		return graphql.Null
   548  	}
   549  	res := resTmp.(string)
   550  	fc.Result = res
   551  	return ec.marshalNID2string(ctx, field.Selections, res)
   552  }
   553  
   554  func (ec *executionContext) _Message_text(ctx context.Context, field graphql.CollectedField, obj *Message) (ret graphql.Marshaler) {
   555  	defer func() {
   556  		if r := recover(); r != nil {
   557  			ec.Error(ctx, ec.Recover(ctx, r))
   558  			ret = graphql.Null
   559  		}
   560  	}()
   561  	fc := &graphql.FieldContext{
   562  		Object:   "Message",
   563  		Field:    field,
   564  		Args:     nil,
   565  		IsMethod: false,
   566  	}
   567  
   568  	ctx = graphql.WithFieldContext(ctx, fc)
   569  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   570  		ctx = rctx // use context from middleware stack in children
   571  		return obj.Text, nil
   572  	})
   573  	if err != nil {
   574  		ec.Error(ctx, err)
   575  		return graphql.Null
   576  	}
   577  	if resTmp == nil {
   578  		if !graphql.HasFieldError(ctx, fc) {
   579  			ec.Errorf(ctx, "must not be null")
   580  		}
   581  		return graphql.Null
   582  	}
   583  	res := resTmp.(string)
   584  	fc.Result = res
   585  	return ec.marshalNString2string(ctx, field.Selections, res)
   586  }
   587  
   588  func (ec *executionContext) _Message_createdBy(ctx context.Context, field graphql.CollectedField, obj *Message) (ret graphql.Marshaler) {
   589  	defer func() {
   590  		if r := recover(); r != nil {
   591  			ec.Error(ctx, ec.Recover(ctx, r))
   592  			ret = graphql.Null
   593  		}
   594  	}()
   595  	fc := &graphql.FieldContext{
   596  		Object:   "Message",
   597  		Field:    field,
   598  		Args:     nil,
   599  		IsMethod: false,
   600  	}
   601  
   602  	ctx = graphql.WithFieldContext(ctx, fc)
   603  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   604  		ctx = rctx // use context from middleware stack in children
   605  		return obj.CreatedBy, nil
   606  	})
   607  	if err != nil {
   608  		ec.Error(ctx, err)
   609  		return graphql.Null
   610  	}
   611  	if resTmp == nil {
   612  		if !graphql.HasFieldError(ctx, fc) {
   613  			ec.Errorf(ctx, "must not be null")
   614  		}
   615  		return graphql.Null
   616  	}
   617  	res := resTmp.(string)
   618  	fc.Result = res
   619  	return ec.marshalNString2string(ctx, field.Selections, res)
   620  }
   621  
   622  func (ec *executionContext) _Message_createdAt(ctx context.Context, field graphql.CollectedField, obj *Message) (ret graphql.Marshaler) {
   623  	defer func() {
   624  		if r := recover(); r != nil {
   625  			ec.Error(ctx, ec.Recover(ctx, r))
   626  			ret = graphql.Null
   627  		}
   628  	}()
   629  	fc := &graphql.FieldContext{
   630  		Object:   "Message",
   631  		Field:    field,
   632  		Args:     nil,
   633  		IsMethod: false,
   634  	}
   635  
   636  	ctx = graphql.WithFieldContext(ctx, fc)
   637  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   638  		ctx = rctx // use context from middleware stack in children
   639  		return obj.CreatedAt, nil
   640  	})
   641  	if err != nil {
   642  		ec.Error(ctx, err)
   643  		return graphql.Null
   644  	}
   645  	if resTmp == nil {
   646  		if !graphql.HasFieldError(ctx, fc) {
   647  			ec.Errorf(ctx, "must not be null")
   648  		}
   649  		return graphql.Null
   650  	}
   651  	res := resTmp.(time.Time)
   652  	fc.Result = res
   653  	return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res)
   654  }
   655  
   656  func (ec *executionContext) _Mutation_post(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
   657  	defer func() {
   658  		if r := recover(); r != nil {
   659  			ec.Error(ctx, ec.Recover(ctx, r))
   660  			ret = graphql.Null
   661  		}
   662  	}()
   663  	fc := &graphql.FieldContext{
   664  		Object:   "Mutation",
   665  		Field:    field,
   666  		Args:     nil,
   667  		IsMethod: true,
   668  	}
   669  
   670  	ctx = graphql.WithFieldContext(ctx, fc)
   671  	rawArgs := field.ArgumentMap(ec.Variables)
   672  	args, err := ec.field_Mutation_post_args(ctx, rawArgs)
   673  	if err != nil {
   674  		ec.Error(ctx, err)
   675  		return graphql.Null
   676  	}
   677  	fc.Args = args
   678  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   679  		ctx = rctx // use context from middleware stack in children
   680  		return ec.resolvers.Mutation().Post(rctx, args["text"].(string), args["username"].(string), args["roomName"].(string))
   681  	})
   682  	if err != nil {
   683  		ec.Error(ctx, err)
   684  		return graphql.Null
   685  	}
   686  	if resTmp == nil {
   687  		if !graphql.HasFieldError(ctx, fc) {
   688  			ec.Errorf(ctx, "must not be null")
   689  		}
   690  		return graphql.Null
   691  	}
   692  	res := resTmp.(*Message)
   693  	fc.Result = res
   694  	return ec.marshalNMessage2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋchatᚐMessage(ctx, field.Selections, res)
   695  }
   696  
   697  func (ec *executionContext) _Query_room(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
   698  	defer func() {
   699  		if r := recover(); r != nil {
   700  			ec.Error(ctx, ec.Recover(ctx, r))
   701  			ret = graphql.Null
   702  		}
   703  	}()
   704  	fc := &graphql.FieldContext{
   705  		Object:   "Query",
   706  		Field:    field,
   707  		Args:     nil,
   708  		IsMethod: true,
   709  	}
   710  
   711  	ctx = graphql.WithFieldContext(ctx, fc)
   712  	rawArgs := field.ArgumentMap(ec.Variables)
   713  	args, err := ec.field_Query_room_args(ctx, rawArgs)
   714  	if err != nil {
   715  		ec.Error(ctx, err)
   716  		return graphql.Null
   717  	}
   718  	fc.Args = args
   719  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   720  		ctx = rctx // use context from middleware stack in children
   721  		return ec.resolvers.Query().Room(rctx, args["name"].(string))
   722  	})
   723  	if err != nil {
   724  		ec.Error(ctx, err)
   725  		return graphql.Null
   726  	}
   727  	if resTmp == nil {
   728  		return graphql.Null
   729  	}
   730  	res := resTmp.(*Chatroom)
   731  	fc.Result = res
   732  	return ec.marshalOChatroom2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋchatᚐChatroom(ctx, field.Selections, res)
   733  }
   734  
   735  func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
   736  	defer func() {
   737  		if r := recover(); r != nil {
   738  			ec.Error(ctx, ec.Recover(ctx, r))
   739  			ret = graphql.Null
   740  		}
   741  	}()
   742  	fc := &graphql.FieldContext{
   743  		Object:   "Query",
   744  		Field:    field,
   745  		Args:     nil,
   746  		IsMethod: true,
   747  	}
   748  
   749  	ctx = graphql.WithFieldContext(ctx, fc)
   750  	rawArgs := field.ArgumentMap(ec.Variables)
   751  	args, err := ec.field_Query___type_args(ctx, rawArgs)
   752  	if err != nil {
   753  		ec.Error(ctx, err)
   754  		return graphql.Null
   755  	}
   756  	fc.Args = args
   757  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   758  		ctx = rctx // use context from middleware stack in children
   759  		return ec.introspectType(args["name"].(string))
   760  	})
   761  	if err != nil {
   762  		ec.Error(ctx, err)
   763  		return graphql.Null
   764  	}
   765  	if resTmp == nil {
   766  		return graphql.Null
   767  	}
   768  	res := resTmp.(*introspection.Type)
   769  	fc.Result = res
   770  	return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
   771  }
   772  
   773  func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
   774  	defer func() {
   775  		if r := recover(); r != nil {
   776  			ec.Error(ctx, ec.Recover(ctx, r))
   777  			ret = graphql.Null
   778  		}
   779  	}()
   780  	fc := &graphql.FieldContext{
   781  		Object:   "Query",
   782  		Field:    field,
   783  		Args:     nil,
   784  		IsMethod: true,
   785  	}
   786  
   787  	ctx = graphql.WithFieldContext(ctx, fc)
   788  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   789  		ctx = rctx // use context from middleware stack in children
   790  		return ec.introspectSchema()
   791  	})
   792  	if err != nil {
   793  		ec.Error(ctx, err)
   794  		return graphql.Null
   795  	}
   796  	if resTmp == nil {
   797  		return graphql.Null
   798  	}
   799  	res := resTmp.(*introspection.Schema)
   800  	fc.Result = res
   801  	return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res)
   802  }
   803  
   804  func (ec *executionContext) _Subscription_messageAdded(ctx context.Context, field graphql.CollectedField) (ret func() graphql.Marshaler) {
   805  	defer func() {
   806  		if r := recover(); r != nil {
   807  			ec.Error(ctx, ec.Recover(ctx, r))
   808  			ret = nil
   809  		}
   810  	}()
   811  	fc := &graphql.FieldContext{
   812  		Object:   "Subscription",
   813  		Field:    field,
   814  		Args:     nil,
   815  		IsMethod: true,
   816  	}
   817  
   818  	ctx = graphql.WithFieldContext(ctx, fc)
   819  	rawArgs := field.ArgumentMap(ec.Variables)
   820  	args, err := ec.field_Subscription_messageAdded_args(ctx, rawArgs)
   821  	if err != nil {
   822  		ec.Error(ctx, err)
   823  		return nil
   824  	}
   825  	fc.Args = args
   826  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   827  		ctx = rctx // use context from middleware stack in children
   828  		return ec.resolvers.Subscription().MessageAdded(rctx, args["roomName"].(string))
   829  	})
   830  	if err != nil {
   831  		ec.Error(ctx, err)
   832  		return nil
   833  	}
   834  	if resTmp == nil {
   835  		if !graphql.HasFieldError(ctx, fc) {
   836  			ec.Errorf(ctx, "must not be null")
   837  		}
   838  		return nil
   839  	}
   840  	return func() graphql.Marshaler {
   841  		res, ok := <-resTmp.(<-chan *Message)
   842  		if !ok {
   843  			return nil
   844  		}
   845  		return graphql.WriterFunc(func(w io.Writer) {
   846  			w.Write([]byte{'{'})
   847  			graphql.MarshalString(field.Alias).MarshalGQL(w)
   848  			w.Write([]byte{':'})
   849  			ec.marshalNMessage2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋchatᚐMessage(ctx, field.Selections, res).MarshalGQL(w)
   850  			w.Write([]byte{'}'})
   851  		})
   852  	}
   853  }
   854  
   855  func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
   856  	defer func() {
   857  		if r := recover(); r != nil {
   858  			ec.Error(ctx, ec.Recover(ctx, r))
   859  			ret = graphql.Null
   860  		}
   861  	}()
   862  	fc := &graphql.FieldContext{
   863  		Object:   "__Directive",
   864  		Field:    field,
   865  		Args:     nil,
   866  		IsMethod: false,
   867  	}
   868  
   869  	ctx = graphql.WithFieldContext(ctx, fc)
   870  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   871  		ctx = rctx // use context from middleware stack in children
   872  		return obj.Name, nil
   873  	})
   874  	if err != nil {
   875  		ec.Error(ctx, err)
   876  		return graphql.Null
   877  	}
   878  	if resTmp == nil {
   879  		if !graphql.HasFieldError(ctx, fc) {
   880  			ec.Errorf(ctx, "must not be null")
   881  		}
   882  		return graphql.Null
   883  	}
   884  	res := resTmp.(string)
   885  	fc.Result = res
   886  	return ec.marshalNString2string(ctx, field.Selections, res)
   887  }
   888  
   889  func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
   890  	defer func() {
   891  		if r := recover(); r != nil {
   892  			ec.Error(ctx, ec.Recover(ctx, r))
   893  			ret = graphql.Null
   894  		}
   895  	}()
   896  	fc := &graphql.FieldContext{
   897  		Object:   "__Directive",
   898  		Field:    field,
   899  		Args:     nil,
   900  		IsMethod: false,
   901  	}
   902  
   903  	ctx = graphql.WithFieldContext(ctx, fc)
   904  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   905  		ctx = rctx // use context from middleware stack in children
   906  		return obj.Description, nil
   907  	})
   908  	if err != nil {
   909  		ec.Error(ctx, err)
   910  		return graphql.Null
   911  	}
   912  	if resTmp == nil {
   913  		return graphql.Null
   914  	}
   915  	res := resTmp.(string)
   916  	fc.Result = res
   917  	return ec.marshalOString2string(ctx, field.Selections, res)
   918  }
   919  
   920  func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
   921  	defer func() {
   922  		if r := recover(); r != nil {
   923  			ec.Error(ctx, ec.Recover(ctx, r))
   924  			ret = graphql.Null
   925  		}
   926  	}()
   927  	fc := &graphql.FieldContext{
   928  		Object:   "__Directive",
   929  		Field:    field,
   930  		Args:     nil,
   931  		IsMethod: false,
   932  	}
   933  
   934  	ctx = graphql.WithFieldContext(ctx, fc)
   935  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   936  		ctx = rctx // use context from middleware stack in children
   937  		return obj.Locations, nil
   938  	})
   939  	if err != nil {
   940  		ec.Error(ctx, err)
   941  		return graphql.Null
   942  	}
   943  	if resTmp == nil {
   944  		if !graphql.HasFieldError(ctx, fc) {
   945  			ec.Errorf(ctx, "must not be null")
   946  		}
   947  		return graphql.Null
   948  	}
   949  	res := resTmp.([]string)
   950  	fc.Result = res
   951  	return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res)
   952  }
   953  
   954  func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
   955  	defer func() {
   956  		if r := recover(); r != nil {
   957  			ec.Error(ctx, ec.Recover(ctx, r))
   958  			ret = graphql.Null
   959  		}
   960  	}()
   961  	fc := &graphql.FieldContext{
   962  		Object:   "__Directive",
   963  		Field:    field,
   964  		Args:     nil,
   965  		IsMethod: false,
   966  	}
   967  
   968  	ctx = graphql.WithFieldContext(ctx, fc)
   969  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   970  		ctx = rctx // use context from middleware stack in children
   971  		return obj.Args, nil
   972  	})
   973  	if err != nil {
   974  		ec.Error(ctx, err)
   975  		return graphql.Null
   976  	}
   977  	if resTmp == nil {
   978  		if !graphql.HasFieldError(ctx, fc) {
   979  			ec.Errorf(ctx, "must not be null")
   980  		}
   981  		return graphql.Null
   982  	}
   983  	res := resTmp.([]introspection.InputValue)
   984  	fc.Result = res
   985  	return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)
   986  }
   987  
   988  func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
   989  	defer func() {
   990  		if r := recover(); r != nil {
   991  			ec.Error(ctx, ec.Recover(ctx, r))
   992  			ret = graphql.Null
   993  		}
   994  	}()
   995  	fc := &graphql.FieldContext{
   996  		Object:   "__EnumValue",
   997  		Field:    field,
   998  		Args:     nil,
   999  		IsMethod: false,
  1000  	}
  1001  
  1002  	ctx = graphql.WithFieldContext(ctx, fc)
  1003  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1004  		ctx = rctx // use context from middleware stack in children
  1005  		return obj.Name, nil
  1006  	})
  1007  	if err != nil {
  1008  		ec.Error(ctx, err)
  1009  		return graphql.Null
  1010  	}
  1011  	if resTmp == nil {
  1012  		if !graphql.HasFieldError(ctx, fc) {
  1013  			ec.Errorf(ctx, "must not be null")
  1014  		}
  1015  		return graphql.Null
  1016  	}
  1017  	res := resTmp.(string)
  1018  	fc.Result = res
  1019  	return ec.marshalNString2string(ctx, field.Selections, res)
  1020  }
  1021  
  1022  func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
  1023  	defer func() {
  1024  		if r := recover(); r != nil {
  1025  			ec.Error(ctx, ec.Recover(ctx, r))
  1026  			ret = graphql.Null
  1027  		}
  1028  	}()
  1029  	fc := &graphql.FieldContext{
  1030  		Object:   "__EnumValue",
  1031  		Field:    field,
  1032  		Args:     nil,
  1033  		IsMethod: false,
  1034  	}
  1035  
  1036  	ctx = graphql.WithFieldContext(ctx, fc)
  1037  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1038  		ctx = rctx // use context from middleware stack in children
  1039  		return obj.Description, nil
  1040  	})
  1041  	if err != nil {
  1042  		ec.Error(ctx, err)
  1043  		return graphql.Null
  1044  	}
  1045  	if resTmp == nil {
  1046  		return graphql.Null
  1047  	}
  1048  	res := resTmp.(string)
  1049  	fc.Result = res
  1050  	return ec.marshalOString2string(ctx, field.Selections, res)
  1051  }
  1052  
  1053  func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
  1054  	defer func() {
  1055  		if r := recover(); r != nil {
  1056  			ec.Error(ctx, ec.Recover(ctx, r))
  1057  			ret = graphql.Null
  1058  		}
  1059  	}()
  1060  	fc := &graphql.FieldContext{
  1061  		Object:   "__EnumValue",
  1062  		Field:    field,
  1063  		Args:     nil,
  1064  		IsMethod: true,
  1065  	}
  1066  
  1067  	ctx = graphql.WithFieldContext(ctx, fc)
  1068  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1069  		ctx = rctx // use context from middleware stack in children
  1070  		return obj.IsDeprecated(), nil
  1071  	})
  1072  	if err != nil {
  1073  		ec.Error(ctx, err)
  1074  		return graphql.Null
  1075  	}
  1076  	if resTmp == nil {
  1077  		if !graphql.HasFieldError(ctx, fc) {
  1078  			ec.Errorf(ctx, "must not be null")
  1079  		}
  1080  		return graphql.Null
  1081  	}
  1082  	res := resTmp.(bool)
  1083  	fc.Result = res
  1084  	return ec.marshalNBoolean2bool(ctx, field.Selections, res)
  1085  }
  1086  
  1087  func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
  1088  	defer func() {
  1089  		if r := recover(); r != nil {
  1090  			ec.Error(ctx, ec.Recover(ctx, r))
  1091  			ret = graphql.Null
  1092  		}
  1093  	}()
  1094  	fc := &graphql.FieldContext{
  1095  		Object:   "__EnumValue",
  1096  		Field:    field,
  1097  		Args:     nil,
  1098  		IsMethod: true,
  1099  	}
  1100  
  1101  	ctx = graphql.WithFieldContext(ctx, fc)
  1102  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1103  		ctx = rctx // use context from middleware stack in children
  1104  		return obj.DeprecationReason(), nil
  1105  	})
  1106  	if err != nil {
  1107  		ec.Error(ctx, err)
  1108  		return graphql.Null
  1109  	}
  1110  	if resTmp == nil {
  1111  		return graphql.Null
  1112  	}
  1113  	res := resTmp.(*string)
  1114  	fc.Result = res
  1115  	return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
  1116  }
  1117  
  1118  func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
  1119  	defer func() {
  1120  		if r := recover(); r != nil {
  1121  			ec.Error(ctx, ec.Recover(ctx, r))
  1122  			ret = graphql.Null
  1123  		}
  1124  	}()
  1125  	fc := &graphql.FieldContext{
  1126  		Object:   "__Field",
  1127  		Field:    field,
  1128  		Args:     nil,
  1129  		IsMethod: false,
  1130  	}
  1131  
  1132  	ctx = graphql.WithFieldContext(ctx, fc)
  1133  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1134  		ctx = rctx // use context from middleware stack in children
  1135  		return obj.Name, nil
  1136  	})
  1137  	if err != nil {
  1138  		ec.Error(ctx, err)
  1139  		return graphql.Null
  1140  	}
  1141  	if resTmp == nil {
  1142  		if !graphql.HasFieldError(ctx, fc) {
  1143  			ec.Errorf(ctx, "must not be null")
  1144  		}
  1145  		return graphql.Null
  1146  	}
  1147  	res := resTmp.(string)
  1148  	fc.Result = res
  1149  	return ec.marshalNString2string(ctx, field.Selections, res)
  1150  }
  1151  
  1152  func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
  1153  	defer func() {
  1154  		if r := recover(); r != nil {
  1155  			ec.Error(ctx, ec.Recover(ctx, r))
  1156  			ret = graphql.Null
  1157  		}
  1158  	}()
  1159  	fc := &graphql.FieldContext{
  1160  		Object:   "__Field",
  1161  		Field:    field,
  1162  		Args:     nil,
  1163  		IsMethod: false,
  1164  	}
  1165  
  1166  	ctx = graphql.WithFieldContext(ctx, fc)
  1167  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1168  		ctx = rctx // use context from middleware stack in children
  1169  		return obj.Description, nil
  1170  	})
  1171  	if err != nil {
  1172  		ec.Error(ctx, err)
  1173  		return graphql.Null
  1174  	}
  1175  	if resTmp == nil {
  1176  		return graphql.Null
  1177  	}
  1178  	res := resTmp.(string)
  1179  	fc.Result = res
  1180  	return ec.marshalOString2string(ctx, field.Selections, res)
  1181  }
  1182  
  1183  func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
  1184  	defer func() {
  1185  		if r := recover(); r != nil {
  1186  			ec.Error(ctx, ec.Recover(ctx, r))
  1187  			ret = graphql.Null
  1188  		}
  1189  	}()
  1190  	fc := &graphql.FieldContext{
  1191  		Object:   "__Field",
  1192  		Field:    field,
  1193  		Args:     nil,
  1194  		IsMethod: false,
  1195  	}
  1196  
  1197  	ctx = graphql.WithFieldContext(ctx, fc)
  1198  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1199  		ctx = rctx // use context from middleware stack in children
  1200  		return obj.Args, nil
  1201  	})
  1202  	if err != nil {
  1203  		ec.Error(ctx, err)
  1204  		return graphql.Null
  1205  	}
  1206  	if resTmp == nil {
  1207  		if !graphql.HasFieldError(ctx, fc) {
  1208  			ec.Errorf(ctx, "must not be null")
  1209  		}
  1210  		return graphql.Null
  1211  	}
  1212  	res := resTmp.([]introspection.InputValue)
  1213  	fc.Result = res
  1214  	return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)
  1215  }
  1216  
  1217  func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
  1218  	defer func() {
  1219  		if r := recover(); r != nil {
  1220  			ec.Error(ctx, ec.Recover(ctx, r))
  1221  			ret = graphql.Null
  1222  		}
  1223  	}()
  1224  	fc := &graphql.FieldContext{
  1225  		Object:   "__Field",
  1226  		Field:    field,
  1227  		Args:     nil,
  1228  		IsMethod: false,
  1229  	}
  1230  
  1231  	ctx = graphql.WithFieldContext(ctx, fc)
  1232  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1233  		ctx = rctx // use context from middleware stack in children
  1234  		return obj.Type, nil
  1235  	})
  1236  	if err != nil {
  1237  		ec.Error(ctx, err)
  1238  		return graphql.Null
  1239  	}
  1240  	if resTmp == nil {
  1241  		if !graphql.HasFieldError(ctx, fc) {
  1242  			ec.Errorf(ctx, "must not be null")
  1243  		}
  1244  		return graphql.Null
  1245  	}
  1246  	res := resTmp.(*introspection.Type)
  1247  	fc.Result = res
  1248  	return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
  1249  }
  1250  
  1251  func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
  1252  	defer func() {
  1253  		if r := recover(); r != nil {
  1254  			ec.Error(ctx, ec.Recover(ctx, r))
  1255  			ret = graphql.Null
  1256  		}
  1257  	}()
  1258  	fc := &graphql.FieldContext{
  1259  		Object:   "__Field",
  1260  		Field:    field,
  1261  		Args:     nil,
  1262  		IsMethod: true,
  1263  	}
  1264  
  1265  	ctx = graphql.WithFieldContext(ctx, fc)
  1266  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1267  		ctx = rctx // use context from middleware stack in children
  1268  		return obj.IsDeprecated(), nil
  1269  	})
  1270  	if err != nil {
  1271  		ec.Error(ctx, err)
  1272  		return graphql.Null
  1273  	}
  1274  	if resTmp == nil {
  1275  		if !graphql.HasFieldError(ctx, fc) {
  1276  			ec.Errorf(ctx, "must not be null")
  1277  		}
  1278  		return graphql.Null
  1279  	}
  1280  	res := resTmp.(bool)
  1281  	fc.Result = res
  1282  	return ec.marshalNBoolean2bool(ctx, field.Selections, res)
  1283  }
  1284  
  1285  func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
  1286  	defer func() {
  1287  		if r := recover(); r != nil {
  1288  			ec.Error(ctx, ec.Recover(ctx, r))
  1289  			ret = graphql.Null
  1290  		}
  1291  	}()
  1292  	fc := &graphql.FieldContext{
  1293  		Object:   "__Field",
  1294  		Field:    field,
  1295  		Args:     nil,
  1296  		IsMethod: true,
  1297  	}
  1298  
  1299  	ctx = graphql.WithFieldContext(ctx, fc)
  1300  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1301  		ctx = rctx // use context from middleware stack in children
  1302  		return obj.DeprecationReason(), nil
  1303  	})
  1304  	if err != nil {
  1305  		ec.Error(ctx, err)
  1306  		return graphql.Null
  1307  	}
  1308  	if resTmp == nil {
  1309  		return graphql.Null
  1310  	}
  1311  	res := resTmp.(*string)
  1312  	fc.Result = res
  1313  	return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
  1314  }
  1315  
  1316  func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
  1317  	defer func() {
  1318  		if r := recover(); r != nil {
  1319  			ec.Error(ctx, ec.Recover(ctx, r))
  1320  			ret = graphql.Null
  1321  		}
  1322  	}()
  1323  	fc := &graphql.FieldContext{
  1324  		Object:   "__InputValue",
  1325  		Field:    field,
  1326  		Args:     nil,
  1327  		IsMethod: false,
  1328  	}
  1329  
  1330  	ctx = graphql.WithFieldContext(ctx, fc)
  1331  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1332  		ctx = rctx // use context from middleware stack in children
  1333  		return obj.Name, nil
  1334  	})
  1335  	if err != nil {
  1336  		ec.Error(ctx, err)
  1337  		return graphql.Null
  1338  	}
  1339  	if resTmp == nil {
  1340  		if !graphql.HasFieldError(ctx, fc) {
  1341  			ec.Errorf(ctx, "must not be null")
  1342  		}
  1343  		return graphql.Null
  1344  	}
  1345  	res := resTmp.(string)
  1346  	fc.Result = res
  1347  	return ec.marshalNString2string(ctx, field.Selections, res)
  1348  }
  1349  
  1350  func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
  1351  	defer func() {
  1352  		if r := recover(); r != nil {
  1353  			ec.Error(ctx, ec.Recover(ctx, r))
  1354  			ret = graphql.Null
  1355  		}
  1356  	}()
  1357  	fc := &graphql.FieldContext{
  1358  		Object:   "__InputValue",
  1359  		Field:    field,
  1360  		Args:     nil,
  1361  		IsMethod: false,
  1362  	}
  1363  
  1364  	ctx = graphql.WithFieldContext(ctx, fc)
  1365  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1366  		ctx = rctx // use context from middleware stack in children
  1367  		return obj.Description, nil
  1368  	})
  1369  	if err != nil {
  1370  		ec.Error(ctx, err)
  1371  		return graphql.Null
  1372  	}
  1373  	if resTmp == nil {
  1374  		return graphql.Null
  1375  	}
  1376  	res := resTmp.(string)
  1377  	fc.Result = res
  1378  	return ec.marshalOString2string(ctx, field.Selections, res)
  1379  }
  1380  
  1381  func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
  1382  	defer func() {
  1383  		if r := recover(); r != nil {
  1384  			ec.Error(ctx, ec.Recover(ctx, r))
  1385  			ret = graphql.Null
  1386  		}
  1387  	}()
  1388  	fc := &graphql.FieldContext{
  1389  		Object:   "__InputValue",
  1390  		Field:    field,
  1391  		Args:     nil,
  1392  		IsMethod: false,
  1393  	}
  1394  
  1395  	ctx = graphql.WithFieldContext(ctx, fc)
  1396  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1397  		ctx = rctx // use context from middleware stack in children
  1398  		return obj.Type, nil
  1399  	})
  1400  	if err != nil {
  1401  		ec.Error(ctx, err)
  1402  		return graphql.Null
  1403  	}
  1404  	if resTmp == nil {
  1405  		if !graphql.HasFieldError(ctx, fc) {
  1406  			ec.Errorf(ctx, "must not be null")
  1407  		}
  1408  		return graphql.Null
  1409  	}
  1410  	res := resTmp.(*introspection.Type)
  1411  	fc.Result = res
  1412  	return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
  1413  }
  1414  
  1415  func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
  1416  	defer func() {
  1417  		if r := recover(); r != nil {
  1418  			ec.Error(ctx, ec.Recover(ctx, r))
  1419  			ret = graphql.Null
  1420  		}
  1421  	}()
  1422  	fc := &graphql.FieldContext{
  1423  		Object:   "__InputValue",
  1424  		Field:    field,
  1425  		Args:     nil,
  1426  		IsMethod: false,
  1427  	}
  1428  
  1429  	ctx = graphql.WithFieldContext(ctx, fc)
  1430  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1431  		ctx = rctx // use context from middleware stack in children
  1432  		return obj.DefaultValue, nil
  1433  	})
  1434  	if err != nil {
  1435  		ec.Error(ctx, err)
  1436  		return graphql.Null
  1437  	}
  1438  	if resTmp == nil {
  1439  		return graphql.Null
  1440  	}
  1441  	res := resTmp.(*string)
  1442  	fc.Result = res
  1443  	return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
  1444  }
  1445  
  1446  func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
  1447  	defer func() {
  1448  		if r := recover(); r != nil {
  1449  			ec.Error(ctx, ec.Recover(ctx, r))
  1450  			ret = graphql.Null
  1451  		}
  1452  	}()
  1453  	fc := &graphql.FieldContext{
  1454  		Object:   "__Schema",
  1455  		Field:    field,
  1456  		Args:     nil,
  1457  		IsMethod: true,
  1458  	}
  1459  
  1460  	ctx = graphql.WithFieldContext(ctx, fc)
  1461  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1462  		ctx = rctx // use context from middleware stack in children
  1463  		return obj.Types(), nil
  1464  	})
  1465  	if err != nil {
  1466  		ec.Error(ctx, err)
  1467  		return graphql.Null
  1468  	}
  1469  	if resTmp == nil {
  1470  		if !graphql.HasFieldError(ctx, fc) {
  1471  			ec.Errorf(ctx, "must not be null")
  1472  		}
  1473  		return graphql.Null
  1474  	}
  1475  	res := resTmp.([]introspection.Type)
  1476  	fc.Result = res
  1477  	return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res)
  1478  }
  1479  
  1480  func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
  1481  	defer func() {
  1482  		if r := recover(); r != nil {
  1483  			ec.Error(ctx, ec.Recover(ctx, r))
  1484  			ret = graphql.Null
  1485  		}
  1486  	}()
  1487  	fc := &graphql.FieldContext{
  1488  		Object:   "__Schema",
  1489  		Field:    field,
  1490  		Args:     nil,
  1491  		IsMethod: true,
  1492  	}
  1493  
  1494  	ctx = graphql.WithFieldContext(ctx, fc)
  1495  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1496  		ctx = rctx // use context from middleware stack in children
  1497  		return obj.QueryType(), nil
  1498  	})
  1499  	if err != nil {
  1500  		ec.Error(ctx, err)
  1501  		return graphql.Null
  1502  	}
  1503  	if resTmp == nil {
  1504  		if !graphql.HasFieldError(ctx, fc) {
  1505  			ec.Errorf(ctx, "must not be null")
  1506  		}
  1507  		return graphql.Null
  1508  	}
  1509  	res := resTmp.(*introspection.Type)
  1510  	fc.Result = res
  1511  	return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
  1512  }
  1513  
  1514  func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
  1515  	defer func() {
  1516  		if r := recover(); r != nil {
  1517  			ec.Error(ctx, ec.Recover(ctx, r))
  1518  			ret = graphql.Null
  1519  		}
  1520  	}()
  1521  	fc := &graphql.FieldContext{
  1522  		Object:   "__Schema",
  1523  		Field:    field,
  1524  		Args:     nil,
  1525  		IsMethod: true,
  1526  	}
  1527  
  1528  	ctx = graphql.WithFieldContext(ctx, fc)
  1529  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1530  		ctx = rctx // use context from middleware stack in children
  1531  		return obj.MutationType(), nil
  1532  	})
  1533  	if err != nil {
  1534  		ec.Error(ctx, err)
  1535  		return graphql.Null
  1536  	}
  1537  	if resTmp == nil {
  1538  		return graphql.Null
  1539  	}
  1540  	res := resTmp.(*introspection.Type)
  1541  	fc.Result = res
  1542  	return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
  1543  }
  1544  
  1545  func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
  1546  	defer func() {
  1547  		if r := recover(); r != nil {
  1548  			ec.Error(ctx, ec.Recover(ctx, r))
  1549  			ret = graphql.Null
  1550  		}
  1551  	}()
  1552  	fc := &graphql.FieldContext{
  1553  		Object:   "__Schema",
  1554  		Field:    field,
  1555  		Args:     nil,
  1556  		IsMethod: true,
  1557  	}
  1558  
  1559  	ctx = graphql.WithFieldContext(ctx, fc)
  1560  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1561  		ctx = rctx // use context from middleware stack in children
  1562  		return obj.SubscriptionType(), nil
  1563  	})
  1564  	if err != nil {
  1565  		ec.Error(ctx, err)
  1566  		return graphql.Null
  1567  	}
  1568  	if resTmp == nil {
  1569  		return graphql.Null
  1570  	}
  1571  	res := resTmp.(*introspection.Type)
  1572  	fc.Result = res
  1573  	return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
  1574  }
  1575  
  1576  func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
  1577  	defer func() {
  1578  		if r := recover(); r != nil {
  1579  			ec.Error(ctx, ec.Recover(ctx, r))
  1580  			ret = graphql.Null
  1581  		}
  1582  	}()
  1583  	fc := &graphql.FieldContext{
  1584  		Object:   "__Schema",
  1585  		Field:    field,
  1586  		Args:     nil,
  1587  		IsMethod: true,
  1588  	}
  1589  
  1590  	ctx = graphql.WithFieldContext(ctx, fc)
  1591  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1592  		ctx = rctx // use context from middleware stack in children
  1593  		return obj.Directives(), nil
  1594  	})
  1595  	if err != nil {
  1596  		ec.Error(ctx, err)
  1597  		return graphql.Null
  1598  	}
  1599  	if resTmp == nil {
  1600  		if !graphql.HasFieldError(ctx, fc) {
  1601  			ec.Errorf(ctx, "must not be null")
  1602  		}
  1603  		return graphql.Null
  1604  	}
  1605  	res := resTmp.([]introspection.Directive)
  1606  	fc.Result = res
  1607  	return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res)
  1608  }
  1609  
  1610  func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
  1611  	defer func() {
  1612  		if r := recover(); r != nil {
  1613  			ec.Error(ctx, ec.Recover(ctx, r))
  1614  			ret = graphql.Null
  1615  		}
  1616  	}()
  1617  	fc := &graphql.FieldContext{
  1618  		Object:   "__Type",
  1619  		Field:    field,
  1620  		Args:     nil,
  1621  		IsMethod: true,
  1622  	}
  1623  
  1624  	ctx = graphql.WithFieldContext(ctx, fc)
  1625  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1626  		ctx = rctx // use context from middleware stack in children
  1627  		return obj.Kind(), nil
  1628  	})
  1629  	if err != nil {
  1630  		ec.Error(ctx, err)
  1631  		return graphql.Null
  1632  	}
  1633  	if resTmp == nil {
  1634  		if !graphql.HasFieldError(ctx, fc) {
  1635  			ec.Errorf(ctx, "must not be null")
  1636  		}
  1637  		return graphql.Null
  1638  	}
  1639  	res := resTmp.(string)
  1640  	fc.Result = res
  1641  	return ec.marshalN__TypeKind2string(ctx, field.Selections, res)
  1642  }
  1643  
  1644  func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
  1645  	defer func() {
  1646  		if r := recover(); r != nil {
  1647  			ec.Error(ctx, ec.Recover(ctx, r))
  1648  			ret = graphql.Null
  1649  		}
  1650  	}()
  1651  	fc := &graphql.FieldContext{
  1652  		Object:   "__Type",
  1653  		Field:    field,
  1654  		Args:     nil,
  1655  		IsMethod: true,
  1656  	}
  1657  
  1658  	ctx = graphql.WithFieldContext(ctx, fc)
  1659  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1660  		ctx = rctx // use context from middleware stack in children
  1661  		return obj.Name(), nil
  1662  	})
  1663  	if err != nil {
  1664  		ec.Error(ctx, err)
  1665  		return graphql.Null
  1666  	}
  1667  	if resTmp == nil {
  1668  		return graphql.Null
  1669  	}
  1670  	res := resTmp.(*string)
  1671  	fc.Result = res
  1672  	return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
  1673  }
  1674  
  1675  func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
  1676  	defer func() {
  1677  		if r := recover(); r != nil {
  1678  			ec.Error(ctx, ec.Recover(ctx, r))
  1679  			ret = graphql.Null
  1680  		}
  1681  	}()
  1682  	fc := &graphql.FieldContext{
  1683  		Object:   "__Type",
  1684  		Field:    field,
  1685  		Args:     nil,
  1686  		IsMethod: true,
  1687  	}
  1688  
  1689  	ctx = graphql.WithFieldContext(ctx, fc)
  1690  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1691  		ctx = rctx // use context from middleware stack in children
  1692  		return obj.Description(), nil
  1693  	})
  1694  	if err != nil {
  1695  		ec.Error(ctx, err)
  1696  		return graphql.Null
  1697  	}
  1698  	if resTmp == nil {
  1699  		return graphql.Null
  1700  	}
  1701  	res := resTmp.(string)
  1702  	fc.Result = res
  1703  	return ec.marshalOString2string(ctx, field.Selections, res)
  1704  }
  1705  
  1706  func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
  1707  	defer func() {
  1708  		if r := recover(); r != nil {
  1709  			ec.Error(ctx, ec.Recover(ctx, r))
  1710  			ret = graphql.Null
  1711  		}
  1712  	}()
  1713  	fc := &graphql.FieldContext{
  1714  		Object:   "__Type",
  1715  		Field:    field,
  1716  		Args:     nil,
  1717  		IsMethod: true,
  1718  	}
  1719  
  1720  	ctx = graphql.WithFieldContext(ctx, fc)
  1721  	rawArgs := field.ArgumentMap(ec.Variables)
  1722  	args, err := ec.field___Type_fields_args(ctx, rawArgs)
  1723  	if err != nil {
  1724  		ec.Error(ctx, err)
  1725  		return graphql.Null
  1726  	}
  1727  	fc.Args = args
  1728  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1729  		ctx = rctx // use context from middleware stack in children
  1730  		return obj.Fields(args["includeDeprecated"].(bool)), nil
  1731  	})
  1732  	if err != nil {
  1733  		ec.Error(ctx, err)
  1734  		return graphql.Null
  1735  	}
  1736  	if resTmp == nil {
  1737  		return graphql.Null
  1738  	}
  1739  	res := resTmp.([]introspection.Field)
  1740  	fc.Result = res
  1741  	return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res)
  1742  }
  1743  
  1744  func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
  1745  	defer func() {
  1746  		if r := recover(); r != nil {
  1747  			ec.Error(ctx, ec.Recover(ctx, r))
  1748  			ret = graphql.Null
  1749  		}
  1750  	}()
  1751  	fc := &graphql.FieldContext{
  1752  		Object:   "__Type",
  1753  		Field:    field,
  1754  		Args:     nil,
  1755  		IsMethod: true,
  1756  	}
  1757  
  1758  	ctx = graphql.WithFieldContext(ctx, fc)
  1759  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1760  		ctx = rctx // use context from middleware stack in children
  1761  		return obj.Interfaces(), nil
  1762  	})
  1763  	if err != nil {
  1764  		ec.Error(ctx, err)
  1765  		return graphql.Null
  1766  	}
  1767  	if resTmp == nil {
  1768  		return graphql.Null
  1769  	}
  1770  	res := resTmp.([]introspection.Type)
  1771  	fc.Result = res
  1772  	return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res)
  1773  }
  1774  
  1775  func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
  1776  	defer func() {
  1777  		if r := recover(); r != nil {
  1778  			ec.Error(ctx, ec.Recover(ctx, r))
  1779  			ret = graphql.Null
  1780  		}
  1781  	}()
  1782  	fc := &graphql.FieldContext{
  1783  		Object:   "__Type",
  1784  		Field:    field,
  1785  		Args:     nil,
  1786  		IsMethod: true,
  1787  	}
  1788  
  1789  	ctx = graphql.WithFieldContext(ctx, fc)
  1790  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1791  		ctx = rctx // use context from middleware stack in children
  1792  		return obj.PossibleTypes(), nil
  1793  	})
  1794  	if err != nil {
  1795  		ec.Error(ctx, err)
  1796  		return graphql.Null
  1797  	}
  1798  	if resTmp == nil {
  1799  		return graphql.Null
  1800  	}
  1801  	res := resTmp.([]introspection.Type)
  1802  	fc.Result = res
  1803  	return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res)
  1804  }
  1805  
  1806  func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
  1807  	defer func() {
  1808  		if r := recover(); r != nil {
  1809  			ec.Error(ctx, ec.Recover(ctx, r))
  1810  			ret = graphql.Null
  1811  		}
  1812  	}()
  1813  	fc := &graphql.FieldContext{
  1814  		Object:   "__Type",
  1815  		Field:    field,
  1816  		Args:     nil,
  1817  		IsMethod: true,
  1818  	}
  1819  
  1820  	ctx = graphql.WithFieldContext(ctx, fc)
  1821  	rawArgs := field.ArgumentMap(ec.Variables)
  1822  	args, err := ec.field___Type_enumValues_args(ctx, rawArgs)
  1823  	if err != nil {
  1824  		ec.Error(ctx, err)
  1825  		return graphql.Null
  1826  	}
  1827  	fc.Args = args
  1828  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1829  		ctx = rctx // use context from middleware stack in children
  1830  		return obj.EnumValues(args["includeDeprecated"].(bool)), nil
  1831  	})
  1832  	if err != nil {
  1833  		ec.Error(ctx, err)
  1834  		return graphql.Null
  1835  	}
  1836  	if resTmp == nil {
  1837  		return graphql.Null
  1838  	}
  1839  	res := resTmp.([]introspection.EnumValue)
  1840  	fc.Result = res
  1841  	return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res)
  1842  }
  1843  
  1844  func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
  1845  	defer func() {
  1846  		if r := recover(); r != nil {
  1847  			ec.Error(ctx, ec.Recover(ctx, r))
  1848  			ret = graphql.Null
  1849  		}
  1850  	}()
  1851  	fc := &graphql.FieldContext{
  1852  		Object:   "__Type",
  1853  		Field:    field,
  1854  		Args:     nil,
  1855  		IsMethod: true,
  1856  	}
  1857  
  1858  	ctx = graphql.WithFieldContext(ctx, fc)
  1859  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1860  		ctx = rctx // use context from middleware stack in children
  1861  		return obj.InputFields(), nil
  1862  	})
  1863  	if err != nil {
  1864  		ec.Error(ctx, err)
  1865  		return graphql.Null
  1866  	}
  1867  	if resTmp == nil {
  1868  		return graphql.Null
  1869  	}
  1870  	res := resTmp.([]introspection.InputValue)
  1871  	fc.Result = res
  1872  	return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)
  1873  }
  1874  
  1875  func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
  1876  	defer func() {
  1877  		if r := recover(); r != nil {
  1878  			ec.Error(ctx, ec.Recover(ctx, r))
  1879  			ret = graphql.Null
  1880  		}
  1881  	}()
  1882  	fc := &graphql.FieldContext{
  1883  		Object:   "__Type",
  1884  		Field:    field,
  1885  		Args:     nil,
  1886  		IsMethod: true,
  1887  	}
  1888  
  1889  	ctx = graphql.WithFieldContext(ctx, fc)
  1890  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1891  		ctx = rctx // use context from middleware stack in children
  1892  		return obj.OfType(), nil
  1893  	})
  1894  	if err != nil {
  1895  		ec.Error(ctx, err)
  1896  		return graphql.Null
  1897  	}
  1898  	if resTmp == nil {
  1899  		return graphql.Null
  1900  	}
  1901  	res := resTmp.(*introspection.Type)
  1902  	fc.Result = res
  1903  	return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
  1904  }
  1905  
  1906  // endregion **************************** field.gotpl *****************************
  1907  
  1908  // region    **************************** input.gotpl *****************************
  1909  
  1910  // endregion **************************** input.gotpl *****************************
  1911  
  1912  // region    ************************** interface.gotpl ***************************
  1913  
  1914  // endregion ************************** interface.gotpl ***************************
  1915  
  1916  // region    **************************** object.gotpl ****************************
  1917  
  1918  var chatroomImplementors = []string{"Chatroom"}
  1919  
  1920  func (ec *executionContext) _Chatroom(ctx context.Context, sel ast.SelectionSet, obj *Chatroom) graphql.Marshaler {
  1921  	fields := graphql.CollectFields(ec.OperationContext, sel, chatroomImplementors)
  1922  
  1923  	out := graphql.NewFieldSet(fields)
  1924  	var invalids uint32
  1925  	for i, field := range fields {
  1926  		switch field.Name {
  1927  		case "__typename":
  1928  			out.Values[i] = graphql.MarshalString("Chatroom")
  1929  		case "name":
  1930  			out.Values[i] = ec._Chatroom_name(ctx, field, obj)
  1931  			if out.Values[i] == graphql.Null {
  1932  				invalids++
  1933  			}
  1934  		case "messages":
  1935  			out.Values[i] = ec._Chatroom_messages(ctx, field, obj)
  1936  			if out.Values[i] == graphql.Null {
  1937  				invalids++
  1938  			}
  1939  		default:
  1940  			panic("unknown field " + strconv.Quote(field.Name))
  1941  		}
  1942  	}
  1943  	out.Dispatch()
  1944  	if invalids > 0 {
  1945  		return graphql.Null
  1946  	}
  1947  	return out
  1948  }
  1949  
  1950  var messageImplementors = []string{"Message"}
  1951  
  1952  func (ec *executionContext) _Message(ctx context.Context, sel ast.SelectionSet, obj *Message) graphql.Marshaler {
  1953  	fields := graphql.CollectFields(ec.OperationContext, sel, messageImplementors)
  1954  
  1955  	out := graphql.NewFieldSet(fields)
  1956  	var invalids uint32
  1957  	for i, field := range fields {
  1958  		switch field.Name {
  1959  		case "__typename":
  1960  			out.Values[i] = graphql.MarshalString("Message")
  1961  		case "id":
  1962  			out.Values[i] = ec._Message_id(ctx, field, obj)
  1963  			if out.Values[i] == graphql.Null {
  1964  				invalids++
  1965  			}
  1966  		case "text":
  1967  			out.Values[i] = ec._Message_text(ctx, field, obj)
  1968  			if out.Values[i] == graphql.Null {
  1969  				invalids++
  1970  			}
  1971  		case "createdBy":
  1972  			out.Values[i] = ec._Message_createdBy(ctx, field, obj)
  1973  			if out.Values[i] == graphql.Null {
  1974  				invalids++
  1975  			}
  1976  		case "createdAt":
  1977  			out.Values[i] = ec._Message_createdAt(ctx, field, obj)
  1978  			if out.Values[i] == graphql.Null {
  1979  				invalids++
  1980  			}
  1981  		default:
  1982  			panic("unknown field " + strconv.Quote(field.Name))
  1983  		}
  1984  	}
  1985  	out.Dispatch()
  1986  	if invalids > 0 {
  1987  		return graphql.Null
  1988  	}
  1989  	return out
  1990  }
  1991  
  1992  var mutationImplementors = []string{"Mutation"}
  1993  
  1994  func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
  1995  	fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors)
  1996  
  1997  	ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
  1998  		Object: "Mutation",
  1999  	})
  2000  
  2001  	out := graphql.NewFieldSet(fields)
  2002  	var invalids uint32
  2003  	for i, field := range fields {
  2004  		switch field.Name {
  2005  		case "__typename":
  2006  			out.Values[i] = graphql.MarshalString("Mutation")
  2007  		case "post":
  2008  			out.Values[i] = ec._Mutation_post(ctx, field)
  2009  			if out.Values[i] == graphql.Null {
  2010  				invalids++
  2011  			}
  2012  		default:
  2013  			panic("unknown field " + strconv.Quote(field.Name))
  2014  		}
  2015  	}
  2016  	out.Dispatch()
  2017  	if invalids > 0 {
  2018  		return graphql.Null
  2019  	}
  2020  	return out
  2021  }
  2022  
  2023  var queryImplementors = []string{"Query"}
  2024  
  2025  func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
  2026  	fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors)
  2027  
  2028  	ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
  2029  		Object: "Query",
  2030  	})
  2031  
  2032  	out := graphql.NewFieldSet(fields)
  2033  	var invalids uint32
  2034  	for i, field := range fields {
  2035  		switch field.Name {
  2036  		case "__typename":
  2037  			out.Values[i] = graphql.MarshalString("Query")
  2038  		case "room":
  2039  			field := field
  2040  			out.Concurrently(i, func() (res graphql.Marshaler) {
  2041  				defer func() {
  2042  					if r := recover(); r != nil {
  2043  						ec.Error(ctx, ec.Recover(ctx, r))
  2044  					}
  2045  				}()
  2046  				res = ec._Query_room(ctx, field)
  2047  				return res
  2048  			})
  2049  		case "__type":
  2050  			out.Values[i] = ec._Query___type(ctx, field)
  2051  		case "__schema":
  2052  			out.Values[i] = ec._Query___schema(ctx, field)
  2053  		default:
  2054  			panic("unknown field " + strconv.Quote(field.Name))
  2055  		}
  2056  	}
  2057  	out.Dispatch()
  2058  	if invalids > 0 {
  2059  		return graphql.Null
  2060  	}
  2061  	return out
  2062  }
  2063  
  2064  var subscriptionImplementors = []string{"Subscription"}
  2065  
  2066  func (ec *executionContext) _Subscription(ctx context.Context, sel ast.SelectionSet) func() graphql.Marshaler {
  2067  	fields := graphql.CollectFields(ec.OperationContext, sel, subscriptionImplementors)
  2068  	ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
  2069  		Object: "Subscription",
  2070  	})
  2071  	if len(fields) != 1 {
  2072  		ec.Errorf(ctx, "must subscribe to exactly one stream")
  2073  		return nil
  2074  	}
  2075  
  2076  	switch fields[0].Name {
  2077  	case "messageAdded":
  2078  		return ec._Subscription_messageAdded(ctx, fields[0])
  2079  	default:
  2080  		panic("unknown field " + strconv.Quote(fields[0].Name))
  2081  	}
  2082  }
  2083  
  2084  var __DirectiveImplementors = []string{"__Directive"}
  2085  
  2086  func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler {
  2087  	fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors)
  2088  
  2089  	out := graphql.NewFieldSet(fields)
  2090  	var invalids uint32
  2091  	for i, field := range fields {
  2092  		switch field.Name {
  2093  		case "__typename":
  2094  			out.Values[i] = graphql.MarshalString("__Directive")
  2095  		case "name":
  2096  			out.Values[i] = ec.___Directive_name(ctx, field, obj)
  2097  			if out.Values[i] == graphql.Null {
  2098  				invalids++
  2099  			}
  2100  		case "description":
  2101  			out.Values[i] = ec.___Directive_description(ctx, field, obj)
  2102  		case "locations":
  2103  			out.Values[i] = ec.___Directive_locations(ctx, field, obj)
  2104  			if out.Values[i] == graphql.Null {
  2105  				invalids++
  2106  			}
  2107  		case "args":
  2108  			out.Values[i] = ec.___Directive_args(ctx, field, obj)
  2109  			if out.Values[i] == graphql.Null {
  2110  				invalids++
  2111  			}
  2112  		default:
  2113  			panic("unknown field " + strconv.Quote(field.Name))
  2114  		}
  2115  	}
  2116  	out.Dispatch()
  2117  	if invalids > 0 {
  2118  		return graphql.Null
  2119  	}
  2120  	return out
  2121  }
  2122  
  2123  var __EnumValueImplementors = []string{"__EnumValue"}
  2124  
  2125  func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler {
  2126  	fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors)
  2127  
  2128  	out := graphql.NewFieldSet(fields)
  2129  	var invalids uint32
  2130  	for i, field := range fields {
  2131  		switch field.Name {
  2132  		case "__typename":
  2133  			out.Values[i] = graphql.MarshalString("__EnumValue")
  2134  		case "name":
  2135  			out.Values[i] = ec.___EnumValue_name(ctx, field, obj)
  2136  			if out.Values[i] == graphql.Null {
  2137  				invalids++
  2138  			}
  2139  		case "description":
  2140  			out.Values[i] = ec.___EnumValue_description(ctx, field, obj)
  2141  		case "isDeprecated":
  2142  			out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj)
  2143  			if out.Values[i] == graphql.Null {
  2144  				invalids++
  2145  			}
  2146  		case "deprecationReason":
  2147  			out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj)
  2148  		default:
  2149  			panic("unknown field " + strconv.Quote(field.Name))
  2150  		}
  2151  	}
  2152  	out.Dispatch()
  2153  	if invalids > 0 {
  2154  		return graphql.Null
  2155  	}
  2156  	return out
  2157  }
  2158  
  2159  var __FieldImplementors = []string{"__Field"}
  2160  
  2161  func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler {
  2162  	fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors)
  2163  
  2164  	out := graphql.NewFieldSet(fields)
  2165  	var invalids uint32
  2166  	for i, field := range fields {
  2167  		switch field.Name {
  2168  		case "__typename":
  2169  			out.Values[i] = graphql.MarshalString("__Field")
  2170  		case "name":
  2171  			out.Values[i] = ec.___Field_name(ctx, field, obj)
  2172  			if out.Values[i] == graphql.Null {
  2173  				invalids++
  2174  			}
  2175  		case "description":
  2176  			out.Values[i] = ec.___Field_description(ctx, field, obj)
  2177  		case "args":
  2178  			out.Values[i] = ec.___Field_args(ctx, field, obj)
  2179  			if out.Values[i] == graphql.Null {
  2180  				invalids++
  2181  			}
  2182  		case "type":
  2183  			out.Values[i] = ec.___Field_type(ctx, field, obj)
  2184  			if out.Values[i] == graphql.Null {
  2185  				invalids++
  2186  			}
  2187  		case "isDeprecated":
  2188  			out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj)
  2189  			if out.Values[i] == graphql.Null {
  2190  				invalids++
  2191  			}
  2192  		case "deprecationReason":
  2193  			out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj)
  2194  		default:
  2195  			panic("unknown field " + strconv.Quote(field.Name))
  2196  		}
  2197  	}
  2198  	out.Dispatch()
  2199  	if invalids > 0 {
  2200  		return graphql.Null
  2201  	}
  2202  	return out
  2203  }
  2204  
  2205  var __InputValueImplementors = []string{"__InputValue"}
  2206  
  2207  func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler {
  2208  	fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors)
  2209  
  2210  	out := graphql.NewFieldSet(fields)
  2211  	var invalids uint32
  2212  	for i, field := range fields {
  2213  		switch field.Name {
  2214  		case "__typename":
  2215  			out.Values[i] = graphql.MarshalString("__InputValue")
  2216  		case "name":
  2217  			out.Values[i] = ec.___InputValue_name(ctx, field, obj)
  2218  			if out.Values[i] == graphql.Null {
  2219  				invalids++
  2220  			}
  2221  		case "description":
  2222  			out.Values[i] = ec.___InputValue_description(ctx, field, obj)
  2223  		case "type":
  2224  			out.Values[i] = ec.___InputValue_type(ctx, field, obj)
  2225  			if out.Values[i] == graphql.Null {
  2226  				invalids++
  2227  			}
  2228  		case "defaultValue":
  2229  			out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj)
  2230  		default:
  2231  			panic("unknown field " + strconv.Quote(field.Name))
  2232  		}
  2233  	}
  2234  	out.Dispatch()
  2235  	if invalids > 0 {
  2236  		return graphql.Null
  2237  	}
  2238  	return out
  2239  }
  2240  
  2241  var __SchemaImplementors = []string{"__Schema"}
  2242  
  2243  func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler {
  2244  	fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors)
  2245  
  2246  	out := graphql.NewFieldSet(fields)
  2247  	var invalids uint32
  2248  	for i, field := range fields {
  2249  		switch field.Name {
  2250  		case "__typename":
  2251  			out.Values[i] = graphql.MarshalString("__Schema")
  2252  		case "types":
  2253  			out.Values[i] = ec.___Schema_types(ctx, field, obj)
  2254  			if out.Values[i] == graphql.Null {
  2255  				invalids++
  2256  			}
  2257  		case "queryType":
  2258  			out.Values[i] = ec.___Schema_queryType(ctx, field, obj)
  2259  			if out.Values[i] == graphql.Null {
  2260  				invalids++
  2261  			}
  2262  		case "mutationType":
  2263  			out.Values[i] = ec.___Schema_mutationType(ctx, field, obj)
  2264  		case "subscriptionType":
  2265  			out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj)
  2266  		case "directives":
  2267  			out.Values[i] = ec.___Schema_directives(ctx, field, obj)
  2268  			if out.Values[i] == graphql.Null {
  2269  				invalids++
  2270  			}
  2271  		default:
  2272  			panic("unknown field " + strconv.Quote(field.Name))
  2273  		}
  2274  	}
  2275  	out.Dispatch()
  2276  	if invalids > 0 {
  2277  		return graphql.Null
  2278  	}
  2279  	return out
  2280  }
  2281  
  2282  var __TypeImplementors = []string{"__Type"}
  2283  
  2284  func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler {
  2285  	fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors)
  2286  
  2287  	out := graphql.NewFieldSet(fields)
  2288  	var invalids uint32
  2289  	for i, field := range fields {
  2290  		switch field.Name {
  2291  		case "__typename":
  2292  			out.Values[i] = graphql.MarshalString("__Type")
  2293  		case "kind":
  2294  			out.Values[i] = ec.___Type_kind(ctx, field, obj)
  2295  			if out.Values[i] == graphql.Null {
  2296  				invalids++
  2297  			}
  2298  		case "name":
  2299  			out.Values[i] = ec.___Type_name(ctx, field, obj)
  2300  		case "description":
  2301  			out.Values[i] = ec.___Type_description(ctx, field, obj)
  2302  		case "fields":
  2303  			out.Values[i] = ec.___Type_fields(ctx, field, obj)
  2304  		case "interfaces":
  2305  			out.Values[i] = ec.___Type_interfaces(ctx, field, obj)
  2306  		case "possibleTypes":
  2307  			out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj)
  2308  		case "enumValues":
  2309  			out.Values[i] = ec.___Type_enumValues(ctx, field, obj)
  2310  		case "inputFields":
  2311  			out.Values[i] = ec.___Type_inputFields(ctx, field, obj)
  2312  		case "ofType":
  2313  			out.Values[i] = ec.___Type_ofType(ctx, field, obj)
  2314  		default:
  2315  			panic("unknown field " + strconv.Quote(field.Name))
  2316  		}
  2317  	}
  2318  	out.Dispatch()
  2319  	if invalids > 0 {
  2320  		return graphql.Null
  2321  	}
  2322  	return out
  2323  }
  2324  
  2325  // endregion **************************** object.gotpl ****************************
  2326  
  2327  // region    ***************************** type.gotpl *****************************
  2328  
  2329  func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) {
  2330  	return graphql.UnmarshalBoolean(v)
  2331  }
  2332  
  2333  func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler {
  2334  	res := graphql.MarshalBoolean(v)
  2335  	if res == graphql.Null {
  2336  		if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
  2337  			ec.Errorf(ctx, "must not be null")
  2338  		}
  2339  	}
  2340  	return res
  2341  }
  2342  
  2343  func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) {
  2344  	return graphql.UnmarshalID(v)
  2345  }
  2346  
  2347  func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
  2348  	res := graphql.MarshalID(v)
  2349  	if res == graphql.Null {
  2350  		if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
  2351  			ec.Errorf(ctx, "must not be null")
  2352  		}
  2353  	}
  2354  	return res
  2355  }
  2356  
  2357  func (ec *executionContext) marshalNMessage2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋchatᚐMessage(ctx context.Context, sel ast.SelectionSet, v Message) graphql.Marshaler {
  2358  	return ec._Message(ctx, sel, &v)
  2359  }
  2360  
  2361  func (ec *executionContext) marshalNMessage2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋchatᚐMessageᚄ(ctx context.Context, sel ast.SelectionSet, v []Message) graphql.Marshaler {
  2362  	ret := make(graphql.Array, len(v))
  2363  	var wg sync.WaitGroup
  2364  	isLen1 := len(v) == 1
  2365  	if !isLen1 {
  2366  		wg.Add(len(v))
  2367  	}
  2368  	for i := range v {
  2369  		i := i
  2370  		fc := &graphql.FieldContext{
  2371  			Index:  &i,
  2372  			Result: &v[i],
  2373  		}
  2374  		ctx := graphql.WithFieldContext(ctx, fc)
  2375  		f := func(i int) {
  2376  			defer func() {
  2377  				if r := recover(); r != nil {
  2378  					ec.Error(ctx, ec.Recover(ctx, r))
  2379  					ret = nil
  2380  				}
  2381  			}()
  2382  			if !isLen1 {
  2383  				defer wg.Done()
  2384  			}
  2385  			ret[i] = ec.marshalNMessage2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋchatᚐMessage(ctx, sel, v[i])
  2386  		}
  2387  		if isLen1 {
  2388  			f(i)
  2389  		} else {
  2390  			go f(i)
  2391  		}
  2392  
  2393  	}
  2394  	wg.Wait()
  2395  	return ret
  2396  }
  2397  
  2398  func (ec *executionContext) marshalNMessage2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋchatᚐMessage(ctx context.Context, sel ast.SelectionSet, v *Message) graphql.Marshaler {
  2399  	if v == nil {
  2400  		if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
  2401  			ec.Errorf(ctx, "must not be null")
  2402  		}
  2403  		return graphql.Null
  2404  	}
  2405  	return ec._Message(ctx, sel, v)
  2406  }
  2407  
  2408  func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) {
  2409  	return graphql.UnmarshalString(v)
  2410  }
  2411  
  2412  func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
  2413  	res := graphql.MarshalString(v)
  2414  	if res == graphql.Null {
  2415  		if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
  2416  			ec.Errorf(ctx, "must not be null")
  2417  		}
  2418  	}
  2419  	return res
  2420  }
  2421  
  2422  func (ec *executionContext) unmarshalNTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) {
  2423  	return graphql.UnmarshalTime(v)
  2424  }
  2425  
  2426  func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler {
  2427  	res := graphql.MarshalTime(v)
  2428  	if res == graphql.Null {
  2429  		if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
  2430  			ec.Errorf(ctx, "must not be null")
  2431  		}
  2432  	}
  2433  	return res
  2434  }
  2435  
  2436  func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler {
  2437  	return ec.___Directive(ctx, sel, &v)
  2438  }
  2439  
  2440  func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler {
  2441  	ret := make(graphql.Array, len(v))
  2442  	var wg sync.WaitGroup
  2443  	isLen1 := len(v) == 1
  2444  	if !isLen1 {
  2445  		wg.Add(len(v))
  2446  	}
  2447  	for i := range v {
  2448  		i := i
  2449  		fc := &graphql.FieldContext{
  2450  			Index:  &i,
  2451  			Result: &v[i],
  2452  		}
  2453  		ctx := graphql.WithFieldContext(ctx, fc)
  2454  		f := func(i int) {
  2455  			defer func() {
  2456  				if r := recover(); r != nil {
  2457  					ec.Error(ctx, ec.Recover(ctx, r))
  2458  					ret = nil
  2459  				}
  2460  			}()
  2461  			if !isLen1 {
  2462  				defer wg.Done()
  2463  			}
  2464  			ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i])
  2465  		}
  2466  		if isLen1 {
  2467  			f(i)
  2468  		} else {
  2469  			go f(i)
  2470  		}
  2471  
  2472  	}
  2473  	wg.Wait()
  2474  	return ret
  2475  }
  2476  
  2477  func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) {
  2478  	return graphql.UnmarshalString(v)
  2479  }
  2480  
  2481  func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
  2482  	res := graphql.MarshalString(v)
  2483  	if res == graphql.Null {
  2484  		if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
  2485  			ec.Errorf(ctx, "must not be null")
  2486  		}
  2487  	}
  2488  	return res
  2489  }
  2490  
  2491  func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) {
  2492  	var vSlice []interface{}
  2493  	if v != nil {
  2494  		if tmp1, ok := v.([]interface{}); ok {
  2495  			vSlice = tmp1
  2496  		} else {
  2497  			vSlice = []interface{}{v}
  2498  		}
  2499  	}
  2500  	var err error
  2501  	res := make([]string, len(vSlice))
  2502  	for i := range vSlice {
  2503  		res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i])
  2504  		if err != nil {
  2505  			return nil, err
  2506  		}
  2507  	}
  2508  	return res, nil
  2509  }
  2510  
  2511  func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler {
  2512  	ret := make(graphql.Array, len(v))
  2513  	var wg sync.WaitGroup
  2514  	isLen1 := len(v) == 1
  2515  	if !isLen1 {
  2516  		wg.Add(len(v))
  2517  	}
  2518  	for i := range v {
  2519  		i := i
  2520  		fc := &graphql.FieldContext{
  2521  			Index:  &i,
  2522  			Result: &v[i],
  2523  		}
  2524  		ctx := graphql.WithFieldContext(ctx, fc)
  2525  		f := func(i int) {
  2526  			defer func() {
  2527  				if r := recover(); r != nil {
  2528  					ec.Error(ctx, ec.Recover(ctx, r))
  2529  					ret = nil
  2530  				}
  2531  			}()
  2532  			if !isLen1 {
  2533  				defer wg.Done()
  2534  			}
  2535  			ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i])
  2536  		}
  2537  		if isLen1 {
  2538  			f(i)
  2539  		} else {
  2540  			go f(i)
  2541  		}
  2542  
  2543  	}
  2544  	wg.Wait()
  2545  	return ret
  2546  }
  2547  
  2548  func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler {
  2549  	return ec.___EnumValue(ctx, sel, &v)
  2550  }
  2551  
  2552  func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler {
  2553  	return ec.___Field(ctx, sel, &v)
  2554  }
  2555  
  2556  func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler {
  2557  	return ec.___InputValue(ctx, sel, &v)
  2558  }
  2559  
  2560  func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler {
  2561  	ret := make(graphql.Array, len(v))
  2562  	var wg sync.WaitGroup
  2563  	isLen1 := len(v) == 1
  2564  	if !isLen1 {
  2565  		wg.Add(len(v))
  2566  	}
  2567  	for i := range v {
  2568  		i := i
  2569  		fc := &graphql.FieldContext{
  2570  			Index:  &i,
  2571  			Result: &v[i],
  2572  		}
  2573  		ctx := graphql.WithFieldContext(ctx, fc)
  2574  		f := func(i int) {
  2575  			defer func() {
  2576  				if r := recover(); r != nil {
  2577  					ec.Error(ctx, ec.Recover(ctx, r))
  2578  					ret = nil
  2579  				}
  2580  			}()
  2581  			if !isLen1 {
  2582  				defer wg.Done()
  2583  			}
  2584  			ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i])
  2585  		}
  2586  		if isLen1 {
  2587  			f(i)
  2588  		} else {
  2589  			go f(i)
  2590  		}
  2591  
  2592  	}
  2593  	wg.Wait()
  2594  	return ret
  2595  }
  2596  
  2597  func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler {
  2598  	return ec.___Type(ctx, sel, &v)
  2599  }
  2600  
  2601  func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler {
  2602  	ret := make(graphql.Array, len(v))
  2603  	var wg sync.WaitGroup
  2604  	isLen1 := len(v) == 1
  2605  	if !isLen1 {
  2606  		wg.Add(len(v))
  2607  	}
  2608  	for i := range v {
  2609  		i := i
  2610  		fc := &graphql.FieldContext{
  2611  			Index:  &i,
  2612  			Result: &v[i],
  2613  		}
  2614  		ctx := graphql.WithFieldContext(ctx, fc)
  2615  		f := func(i int) {
  2616  			defer func() {
  2617  				if r := recover(); r != nil {
  2618  					ec.Error(ctx, ec.Recover(ctx, r))
  2619  					ret = nil
  2620  				}
  2621  			}()
  2622  			if !isLen1 {
  2623  				defer wg.Done()
  2624  			}
  2625  			ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i])
  2626  		}
  2627  		if isLen1 {
  2628  			f(i)
  2629  		} else {
  2630  			go f(i)
  2631  		}
  2632  
  2633  	}
  2634  	wg.Wait()
  2635  	return ret
  2636  }
  2637  
  2638  func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler {
  2639  	if v == nil {
  2640  		if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
  2641  			ec.Errorf(ctx, "must not be null")
  2642  		}
  2643  		return graphql.Null
  2644  	}
  2645  	return ec.___Type(ctx, sel, v)
  2646  }
  2647  
  2648  func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) {
  2649  	return graphql.UnmarshalString(v)
  2650  }
  2651  
  2652  func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
  2653  	res := graphql.MarshalString(v)
  2654  	if res == graphql.Null {
  2655  		if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
  2656  			ec.Errorf(ctx, "must not be null")
  2657  		}
  2658  	}
  2659  	return res
  2660  }
  2661  
  2662  func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) {
  2663  	return graphql.UnmarshalBoolean(v)
  2664  }
  2665  
  2666  func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler {
  2667  	return graphql.MarshalBoolean(v)
  2668  }
  2669  
  2670  func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) {
  2671  	if v == nil {
  2672  		return nil, nil
  2673  	}
  2674  	res, err := ec.unmarshalOBoolean2bool(ctx, v)
  2675  	return &res, err
  2676  }
  2677  
  2678  func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler {
  2679  	if v == nil {
  2680  		return graphql.Null
  2681  	}
  2682  	return ec.marshalOBoolean2bool(ctx, sel, *v)
  2683  }
  2684  
  2685  func (ec *executionContext) marshalOChatroom2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋchatᚐChatroom(ctx context.Context, sel ast.SelectionSet, v Chatroom) graphql.Marshaler {
  2686  	return ec._Chatroom(ctx, sel, &v)
  2687  }
  2688  
  2689  func (ec *executionContext) marshalOChatroom2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋchatᚐChatroom(ctx context.Context, sel ast.SelectionSet, v *Chatroom) graphql.Marshaler {
  2690  	if v == nil {
  2691  		return graphql.Null
  2692  	}
  2693  	return ec._Chatroom(ctx, sel, v)
  2694  }
  2695  
  2696  func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) {
  2697  	return graphql.UnmarshalString(v)
  2698  }
  2699  
  2700  func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
  2701  	return graphql.MarshalString(v)
  2702  }
  2703  
  2704  func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) {
  2705  	if v == nil {
  2706  		return nil, nil
  2707  	}
  2708  	res, err := ec.unmarshalOString2string(ctx, v)
  2709  	return &res, err
  2710  }
  2711  
  2712  func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler {
  2713  	if v == nil {
  2714  		return graphql.Null
  2715  	}
  2716  	return ec.marshalOString2string(ctx, sel, *v)
  2717  }
  2718  
  2719  func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler {
  2720  	if v == nil {
  2721  		return graphql.Null
  2722  	}
  2723  	ret := make(graphql.Array, len(v))
  2724  	var wg sync.WaitGroup
  2725  	isLen1 := len(v) == 1
  2726  	if !isLen1 {
  2727  		wg.Add(len(v))
  2728  	}
  2729  	for i := range v {
  2730  		i := i
  2731  		fc := &graphql.FieldContext{
  2732  			Index:  &i,
  2733  			Result: &v[i],
  2734  		}
  2735  		ctx := graphql.WithFieldContext(ctx, fc)
  2736  		f := func(i int) {
  2737  			defer func() {
  2738  				if r := recover(); r != nil {
  2739  					ec.Error(ctx, ec.Recover(ctx, r))
  2740  					ret = nil
  2741  				}
  2742  			}()
  2743  			if !isLen1 {
  2744  				defer wg.Done()
  2745  			}
  2746  			ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i])
  2747  		}
  2748  		if isLen1 {
  2749  			f(i)
  2750  		} else {
  2751  			go f(i)
  2752  		}
  2753  
  2754  	}
  2755  	wg.Wait()
  2756  	return ret
  2757  }
  2758  
  2759  func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler {
  2760  	if v == nil {
  2761  		return graphql.Null
  2762  	}
  2763  	ret := make(graphql.Array, len(v))
  2764  	var wg sync.WaitGroup
  2765  	isLen1 := len(v) == 1
  2766  	if !isLen1 {
  2767  		wg.Add(len(v))
  2768  	}
  2769  	for i := range v {
  2770  		i := i
  2771  		fc := &graphql.FieldContext{
  2772  			Index:  &i,
  2773  			Result: &v[i],
  2774  		}
  2775  		ctx := graphql.WithFieldContext(ctx, fc)
  2776  		f := func(i int) {
  2777  			defer func() {
  2778  				if r := recover(); r != nil {
  2779  					ec.Error(ctx, ec.Recover(ctx, r))
  2780  					ret = nil
  2781  				}
  2782  			}()
  2783  			if !isLen1 {
  2784  				defer wg.Done()
  2785  			}
  2786  			ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i])
  2787  		}
  2788  		if isLen1 {
  2789  			f(i)
  2790  		} else {
  2791  			go f(i)
  2792  		}
  2793  
  2794  	}
  2795  	wg.Wait()
  2796  	return ret
  2797  }
  2798  
  2799  func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler {
  2800  	if v == nil {
  2801  		return graphql.Null
  2802  	}
  2803  	ret := make(graphql.Array, len(v))
  2804  	var wg sync.WaitGroup
  2805  	isLen1 := len(v) == 1
  2806  	if !isLen1 {
  2807  		wg.Add(len(v))
  2808  	}
  2809  	for i := range v {
  2810  		i := i
  2811  		fc := &graphql.FieldContext{
  2812  			Index:  &i,
  2813  			Result: &v[i],
  2814  		}
  2815  		ctx := graphql.WithFieldContext(ctx, fc)
  2816  		f := func(i int) {
  2817  			defer func() {
  2818  				if r := recover(); r != nil {
  2819  					ec.Error(ctx, ec.Recover(ctx, r))
  2820  					ret = nil
  2821  				}
  2822  			}()
  2823  			if !isLen1 {
  2824  				defer wg.Done()
  2825  			}
  2826  			ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i])
  2827  		}
  2828  		if isLen1 {
  2829  			f(i)
  2830  		} else {
  2831  			go f(i)
  2832  		}
  2833  
  2834  	}
  2835  	wg.Wait()
  2836  	return ret
  2837  }
  2838  
  2839  func (ec *executionContext) marshalO__Schema2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v introspection.Schema) graphql.Marshaler {
  2840  	return ec.___Schema(ctx, sel, &v)
  2841  }
  2842  
  2843  func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler {
  2844  	if v == nil {
  2845  		return graphql.Null
  2846  	}
  2847  	return ec.___Schema(ctx, sel, v)
  2848  }
  2849  
  2850  func (ec *executionContext) marshalO__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler {
  2851  	return ec.___Type(ctx, sel, &v)
  2852  }
  2853  
  2854  func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler {
  2855  	if v == nil {
  2856  		return graphql.Null
  2857  	}
  2858  	ret := make(graphql.Array, len(v))
  2859  	var wg sync.WaitGroup
  2860  	isLen1 := len(v) == 1
  2861  	if !isLen1 {
  2862  		wg.Add(len(v))
  2863  	}
  2864  	for i := range v {
  2865  		i := i
  2866  		fc := &graphql.FieldContext{
  2867  			Index:  &i,
  2868  			Result: &v[i],
  2869  		}
  2870  		ctx := graphql.WithFieldContext(ctx, fc)
  2871  		f := func(i int) {
  2872  			defer func() {
  2873  				if r := recover(); r != nil {
  2874  					ec.Error(ctx, ec.Recover(ctx, r))
  2875  					ret = nil
  2876  				}
  2877  			}()
  2878  			if !isLen1 {
  2879  				defer wg.Done()
  2880  			}
  2881  			ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i])
  2882  		}
  2883  		if isLen1 {
  2884  			f(i)
  2885  		} else {
  2886  			go f(i)
  2887  		}
  2888  
  2889  	}
  2890  	wg.Wait()
  2891  	return ret
  2892  }
  2893  
  2894  func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler {
  2895  	if v == nil {
  2896  		return graphql.Null
  2897  	}
  2898  	return ec.___Type(ctx, sel, v)
  2899  }
  2900  
  2901  // endregion ***************************** type.gotpl *****************************