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

Composition Error when Fed 1 subgraph redefines a built-in scalar #2806

Closed
tinnou opened this issue Oct 4, 2023 · 0 comments
Closed

Composition Error when Fed 1 subgraph redefines a built-in scalar #2806

tinnou opened this issue Oct 4, 2023 · 0 comments
Assignees

Comments

@tinnou
Copy link
Contributor

tinnou commented Oct 4, 2023

Issue Description

Description

Redefining built-in scalar in Fed 1 subgraphs throws a validation error, it's happening in internals-js/validate.ts.

The following test:

it('repro redefined built-in scalar breaks @key directive', () => {
    const subgraphA = {
      typeDefs: gql`
        type Query {
          q: String
        }
        type A @key(fields: "k") {
          k: ID!
        }
        scalar Boolean
      `,
      name: 'subgraphA',
    };

    const result = composeServices([subgraphA,]);
    assertCompositionSuccess(result);
  });

throws

Error: `[subgraphA] Invalid default value (got: true) provided for argument @key(resolvable:) of type Boolean.

Link to Reproduction

1e48e2b

Reproduction Steps

I wrote a unit test in composeFed1Subgraphs.test.ts that reproduces the issue.

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

2 participants