Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SchemaTransform includes Entities in the _Entity union when @key(resolvable=false) #412

Open
NavidMitchell opened this issue Jun 13, 2024 · 0 comments

Comments

@NavidMitchell
Copy link

According to the Federation spec Entities that have @key(resolvable=false) should not be included in the _Entity union.

"The _Entity union must include all entity types that are defined in the subgraph schema, except entities with a @key that sets resolvable: false."
Spec Doc

The following code from the SchemaTransformer does not consider the resolvable field.

  private Predicate<GraphQLNamedType> entityPredicate() {
    return type -> {
      if (type instanceof GraphQLDirectiveContainer) {
        GraphQLDirectiveContainer entityCandidate = (GraphQLDirectiveContainer) type;
        return entityCandidate
                .getAllAppliedDirectivesByName()
                .containsKey(FederationDirectives.keyName)
            || entityCandidate.getAllDirectivesByName().containsKey(FederationDirectives.keyName);
      } else {
        return false;
      }
    };
  }
@NavidMitchell NavidMitchell changed the title Transform includes Entities in the _Entity union when @key(resolvable=false) SchemaTransform includes Entities in the _Entity union when @key(resolvable=false) Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant