ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
5.28k stars 748 forks source link

ExportDirective with type argument fails to prepend `@` to directive name #7799

Open willgittoes opened 23 hours ago

willgittoes commented 23 hours ago

Product

Hot Chocolate

Version

14.2.0-p.7

Link to minimal reproduction

https://github.com/ChilliCream/hotchocolate-examples/pull/69/files

Steps to reproduce

  1. Check out branch in MR
  2. Run once, service will save schema file when it starts

Bug is:

  1. Use ExportDirective with a type parameter (rather than giving a string)
  2. The created composeDirective does not prefix the directive to compose with @

What is expected?

The created composeDirective prefixes the directive to compose with @

What is actually happening?

The created composeDirective does not prefix the directive to compose with @

Relevant log output

Additional context

Workaround is to pass a string rather than use a type param

willgittoes commented 21 hours ago

Bonus bug/feature request:

RemoveUnreachableTypes removes directives that are referenced in composeDirective unless they're also used somewhere else, leading to a schema error when you try to compose the schema in Apollo. RemoveUnreachableTypes should consider being referenced in composeDirective as being reachable.

willgittoes commented 20 hours ago

Double-bonus bug/feature request:

DirectiveTypeInterceptor also discards directives in the same way, marking them as being unused.

michaelstaib commented 8 hours ago

We have dropped support for @export with version 14.

michaelstaib commented 8 hours ago

Is your question about exporting directives in apollo federation?