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)
| 302 | // to resolve a query/mutation it doesn't know how to rewrite, it uses |
| 303 | // the queryError/mutationError to build an error result. |
| 304 | func 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 |
no outgoing calls