My group is planning to use Apollo Gateway for federation. Therefore, we need to produce our schemas a little bit differently.
Can we produce something like this with using your amazing lib?
extend type User @key(fields: "id") {
id: ID! @external
reviews: [Review]
}
You want to add some fields and directives to a type?
You can use
@GraphQLContext
to attach external methods as fields. Or even provide a customResolverBuilder
that returns additionalResolver
s (these later get mapped to fields). To add directives, you can create annotations meta-annotated with@GraphQLDirective
(see the tests for examples). Lastly, you can of course provide a customTypeMapper
forUser
and fully take control of how that type gets mapped.E.g. you can make an annotation like:
If you then place this annotation on a type:
it will get mapped as:
I presume you know about
@GraphQLContext
, but in short:Because of
@GraphQLContext
, the typeUser
now has areview: [Review]
field (even though theUser
class does not have that field).