federation
federation copied to clipboard
ComposeDirective should be added to the apiSchema as well as the supergraph schema.
Description
ComposeDirective currently has all directives from the supergraph stripped from the final api schema. This makes it difficult to implement a custom directive in a federated gateway as the directive is not included in the api schema.
All directives are removed here.
An option would be to add composeDirective directives to the api schema or alternatively extend the composeDirective to take an option @composeDirective(name: "@foo", includeInApiSchema: true)
or equivalent.
This seems consistent with what I'm seeing in router as well https://github.com/apollographql/router/discussions/4793. We are working on upgrading to Fed 2 and router independently, getting this functionality in both places would help
I would like to raise this aswell.
Implementing a custom directive with a
import { mapSchema } from "@graphql-tools/utils";
Is currently impossible. I have a suspicion that this might be by design to push people towards the paid apollo router?