federation icon indicating copy to clipboard operation
federation copied to clipboard

ComposeDirective should be added to the apiSchema as well as the supergraph schema.

Open darren-west opened this issue 1 year ago • 2 comments

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.

darren-west avatar Dec 20 '23 13:12 darren-west

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

jmccaull avatar Mar 13 '24 15:03 jmccaull

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?

Inlustra avatar Mar 28 '24 15:03 Inlustra