type MutationFn func(inputMap map[string]interface{}, info graphql.ResolveInfo, ctx context.Context) (map[string]interface{}, error)
it is a convention to have context.Context as the first parameter in functions. So, the signature should be
type MutationFn func(ctx context.Context, inputMap map[string]interface{}, info graphql.ResolveInfo) (map[string]interface{}, error)
ref: https://godoc.org/golang.org/x/net/context
Do not store Contexts inside a struct type; instead, pass a Context explicitly to each function that needs it. _The Context should be the first parameter, typically named ctx _:
Hi,
MutationFn
has the following signature.Edit: same with
IDFetcherFn
type MutationFn func(inputMap map[string]interface{}, info graphql.ResolveInfo, ctx context.Context) (map[string]interface{}, error)
it is a convention to havecontext.Context
as the first parameter in functions. So, the signature should betype MutationFn func(ctx context.Context, inputMap map[string]interface{}, info graphql.ResolveInfo) (map[string]interface{}, error)
ref: https://godoc.org/golang.org/x/net/contextDo not store Contexts inside a struct type; instead, pass a Context explicitly to each function that needs it. _The Context should be the first parameter, typically named ctx _: