I’m building a plugin for the library which will generate the
__resolveReference resolvers needed for a Federation router. I want this plugin to be part of the augmentation flow, rather than completely redirecting logic when we “realise” Federation is happening.
We currently have a
getSchema function which builds a schema using
graphql-tools and returns it. This has already been an obstacle given that
buildSubgraphSchema is so different, so we added a new function to return unbuilt type definitions and resolvers. We used
graphql-tools, as once again, this is essentially the industry standard for creating GraphQL schemas.
However, here I am again struggling with Apollo’s custom typings, because
buildSubgraphSchema accepts a
DocumentNode I can kind of see… But the
GraphQLResolverMap is proving to be a nightmare. It’s not an option for us to use an Apollo specific type for our generic export, and we don’t want our users to have to do a tonne of manipulation to the
IResolvers type to get it working with
buildSubgraphSchema. Any suggestions here?