Hello community,
I'm currently trying to extend my setup to be able to use Apollo GraphQL server (lambda version) with an additional datastore (DynamoDB in this particular case). I stumbled upon the following mentions for writing custom resolvers for additional datasets:
and
However, trying to implement any of these gives me no decent results. I don't understand what I'm doing wrong here.
Let me quickly set the context:
I only have one typeDefs file where I define all Neo4j and non-Neo4j types, queries and mutations.
Here's a snippet of my schema that I'd like to write a custom resolver for:
type PodcastBasicStatisticsSubmission {
podcastId: String
}
So, in my dynamodb resolver file (just for the sake of a test) I do:
const resolvers = {
PodcastBasicStatisticsSubmission: {
podcastId: (obj, params, ctx, resolveInfo) => {
return 'test';
}
}
};
export default resolvers;
Then in my main Apollo configuration file I do:
import dynamodbResolvers from './databases/dynamodb/dynamodb';
const resolvers = dynamodbResolvers;
const schema = makeAugmentedSchema({
typeDefs,
resolvers,
config: {
query: {
exclude: ['PodcastBasicStatisticsSubmission']
},
mutation: {
exclude: ['PodcastBasicStatisticsSubmission']
}
}
});
I do NOT include resolvers in my ApolloServer configuration as demonstrated by @lyonwj here
Example by William Lyon
In my Apollo Playground I do see my type definition but, no queries or mutations, obviously.
I can't query my type as I normally could with everything that's currently inside my Neo4j instance and for what resolvers have been created by makeAugmentedSchema.
Clearly, I'm missing some fundamental stuff here but what?
Any clues?