Hello!
** I have editted this fairly heavily since I have made progress on this.
I have a system with two subgraphs, Users and Groups. The Group subgraph starts up a third entity for tracking conflicts between Groups and their Members.
In the Group subgraph:
type ConflictList @key(fields: "userId group { id }") {
id: ID!
group: Group!
changeRequest: GroupChangeRequest!
}
type Group @key(fields: "id") {
id: ID!
suggestedMembers: [User!]!
}
In the User subgraph:
type Group @key(fields: "id") {
id: ID!
suggestedMembers: [User!]! @external
meetingCount: Int! @external
}
type GroupChangeRequest @key(fields: "id") {
id: ID!
meetingCount: Int! @external
}
type ConflictList @key(fields: "userId group { id }") {
userId: ID!
group: Group! @external
changeRequest: GroupChangeRequest! @external
conflicts: [String!]! @requires(fields: "group { meetingCount suggestedMembers { id } } change { meetingCount }"
}
I ran into an issue in NestJS where this fails to boot the user subgraph which I will address separately. I got these both to boot with apollo-server, but now with gateway, I get a composition error
mutation<someExampleMutation>
cannot be satisfied by the subgraphs because:
- from subgraph "groups": cannot find field "ConflictList.conflicts".
- from subgraph "users": cannot satisfy @require conditions on field "ConflictList.conflicts" (please ensure that this is not due to key field "group" being accidentally marked @external).
The group subgraph resolves out the userId and the group. User subgraph resolves out the conflicts. What am I doing wrong? This should work… The group is not accidentally marked @external