Closed damienpontifex closed 1 year ago
This would be great... but it looks like HotChocolate
API does not allow for this :( Since schema builder mechanism is considered "deprecated", I'm guessing it won't be fixed (I'll open up an issue) and we'll have to wait for the new "skimmed" API to stabilize.
My attempt -> https://github.com/apollographql/federation-hotchocolate/pull/47
The underlying issue is that we cannot apply multiple SetSchema
lambdas as instead of doing cumulative updates from all applied lambdas, only the last one is applied. This is the behavior I'd expect from SetSchema(object)
and sounds like a miss on the lambda front.
Maybe a Action
argument to the AddApolloFederationV2
method then might work better? Then it can be configured as the federated schema is configured?
Good idea. This could work -> https://github.com/apollographql/federation-hotchocolate/pull/47/commits/b93b2249ee0acc8c3e97d3c70fb2ffb83ce25cf7
@dariuszkuc looks good. What's the ComposeDirective
bit...might be just a method in hot chocolate I haven't used before?
It's just the same to setup contact directive in a similar way I assume
👋 @composeDirective
is a federation directive that allows you to preserve your directives in the supergraph (by default they got stripped out), see docs
Both @contact
and @composeDirective
are applicable on a schema.
It would be nice to have a convenience/extension method for adding contact info instead of the custom schema object as referenced in the README.
Proposal
This would make configuration inline with other graphql configuration and avoid needing to define a custom schema type only to add this attribute.