Cannot satisfy @require conditions on field

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

Hello! Are you using managed federation for your graphs and publishing them with Rover to Apollo Studio? Which version of composition are you using?

Thanks for replying!

We’re using managed federation but at the moment I’ve just got them composing in a local gateway. We are using version 2.1.3. I haven’t published this change yet because it wasn’t working.

I’ve managed to get the error to go away by removing the reference to the group id in the key, but now the key is just userId, which makes me a little nervous that the gateway will reuse these for different groups. I guess I could add a groupId field just for key. I just don’t know why group { id } was causing this error message. The field resolver will always resolve out the two keys and group is marked as non-nullable.

This data type is an edge between users, groups, and a request to change groups. I feel like this shouldn’t be a controversial use of federation but maybe I’m wrong about that.