Open rohinz opened 12 months ago
Hello 👋
I believe this is due to the limitations of the existing HC TypeInterceptor
API (that 🤞 will be fixed in their replacement "skimmed" API which is still WIP). Underlying issue is that current HC API is somewhat finicky and depending on the order of processed items you can have side effects that break other things. AFAIK currently it is not possible to apply multiple schema transformations (see: https://github.com/ChilliCream/graphql-platform/issues/6651) so you only get the results of applying the last transformation.
Since the @link
definitions are getting removed it looks like HotChocolate.AspNetCore.Authorization
also attempts to change the schema object so you will only get the last transformation. You could try changing the order of the extension but I wouldn't be surprised if your HC authorization logic stops working in that case, i.e.
builder.Services
.AddGraphQLServer()
.AddAuthorization()
.AddApolloFederationV2()
.AddQueryType<Query>();
@dariuszkuc Changing order still resulted in same behaviour (@link missing) which resulted in federation compatibility issue
Adding
HotChocolate.AspNetCore.Authorization
to the schema removes the@link
directive from the schema.How to reproduce
dotnet run -- schema export
the schema contains the
@link
directiveHotChocolate.AspNetCore.Authorization
nuget and add authorization to the schema builder:dotnet run -- schema export
Expectation
@link
directiveCurrent Behavior
@link
directive is gone :-(