cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site maintenance this Wednesday, February 1. Disruptions expected as we migrate the forums.

GraphQL custom resolvers extending auto-generated resolvers

I'm using GraphQL on top of Neo4j with the @neo4j/graphql NodeJS library.

I'd like to implement custom resolvers that re-use the auto-generated resolvers, but then extend them by doing advanced filtering, augmenting the results,...

So simply put, in the example given here:

where it says "implement resolver here" I want to first get the results from the auto-generated resolver (also passing on any possible 'where' clause,...) and then do my own magic with it.

However I can't find how to call the auto-generated resolver from the custom resolver. It feels like it should be simple but I don't see it 😞

Any ideas?

2 REPLIES 2

Anyone?

Meanwhile, I've found that this is possible with the old neo4-graphql-js library in a very straight-forward manner:

import { neo4jgraphql } from 'neo4j-graphql-js';

const resolvers = {
  Query: {
    Movie(object, params, ctx, resolveInfo) {
      const movies = neo4jgraphql(object, params, ctx, resolveInfo);
      // do stuff with movies
      return movies;
    }
  }
};

DomVinyard
Node Link