mercurius-gateway
mercurius-gateway copied to clipboard
Gateway does not merge Query, Mutation and Subscription properly if `extend` is not used
The gateway doesn't merge services schema correctly if extend
is not used.
The following schemas:
type Notification {
id: ID!
message: String
}
type Query {
notifications: [Notification]
}
type User {
id: ID!
name: String
}
type Query {
users: [User]
}
Produces:
directive @external on FIELD_DEFINITION
directive @requires(fields: _FieldSet!) on FIELD_DEFINITION
directive @provides(fields: _FieldSet!) on FIELD_DEFINITION
directive @key(fields: _FieldSet!) on OBJECT | INTERFACE
directive @extends on OBJECT | INTERFACE
scalar _Any
scalar _FieldSet
type User {
id: ID!
name: String
}
type Query {
notifications: [Notification]
}
type Notification {
id: ID!
message: String
}
Current workaround: always use extend type Query/Mutation/Subscription
for federated services.
Related to: mercurius-js/mercurius#262
Would you like to send a PR?
Would you like to send a PR?
I don't have the time right now to investigate this issue, I'll try to fix the issue later if it hasn't been fixed yet.
Does anyone has experience with implementing the proposed workaround with nestjs/graphql or type-graphql? I also tried adding it in transformSchema, but the server doesn't start.
Unfortunately, I don't have enough time right now to fix the issue, hence I need the workaround...
For future readers: The workaround was implemented in nestjs-mercurius. PR