apollographql / apollographql/federation
ComposeDirective should be added to the apiSchema as well as the supergraph schema.
- Dominant language
- TypeScript
- Stars
- 725
- Forks
- 276
- Avg merge
- 1h 47m
- Merged PRs (30d)
- 1
Description
### 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](https://github.com/apollographql/federation/blob/f69a0694b95e99c22f0d5f7bc6df1b46568b2a8d/internals-js/src/specs/coreSpec.ts#L856).
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.
Contributor guide
Research direction
Start in internals-js/src/specs/coreSpec.ts around the directive-removal logic linked in the issue. Trace how ComposeDirective directives are stripped from the API schema, then determine whether the intended behavior is unconditional inclusion or an includeInApiSchema option; done means custom composed directives are available in the final API schema.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, typescript
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100