MCPcopy
hub / github.com/dgraph-io/dgraph / NewResolverFactory

Function NewResolverFactory

graphql/resolve/resolver.go:304–317  ·  view source on GitHub ↗

NewResolverFactory returns a ResolverFactory that resolves requests via query/mutation rewriting and execution through Dgraph. If the factory gets asked to resolve a query/mutation it doesn't know how to rewrite, it uses the queryError/mutationError to build an error result.

(
	queryError QueryResolverFunc, mutationError MutationResolverFunc)

Source from the content-addressed store, hash-verified

302// to resolve a query/mutation it doesn't know how to rewrite, it uses
303// the queryError/mutationError to build an error result.
304func NewResolverFactory(
305 queryError QueryResolverFunc, mutationError MutationResolverFunc) ResolverFactory {
306
307 return &resolverFactory{
308 queryResolvers: make(map[string]func(schema.Query) QueryResolver),
309 mutationResolvers: make(map[string]func(schema.Mutation) MutationResolver),
310
311 queryMiddlewareConfig: make(map[string]QueryMiddlewares),
312 mutationMiddlewareConfig: make(map[string]MutationMiddlewares),
313
314 queryError: queryError,
315 mutationError: mutationError,
316 }
317}
318
319// entitiesQueryCompletion transform the result of the `_entities` query.
320// It changes the order of the result to the order of keyField in the

Callers 4

panicCatcherFunction · 0.92
clientInfoLoginFunction · 0.92
resolveWithClientFunction · 0.85

Calls

no outgoing calls

Tested by 1

resolveWithClientFunction · 0.68