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

Required input field X cannot be deprecated does not work when composition #892

Open
flymedllva opened this issue Jun 26, 2024 · 2 comments
Assignees
Labels
confirmed bug The issue was replicated/determined to be a bug. internally-reviewed The issue has been reviewed internally.

Comments

@flymedllva
Copy link
Contributor

flymedllva commented Jun 26, 2024

Component(s)

composition

Component version

0.89.1

wgc version

0.53.2

controlplane version

router version

0.89.1

What happened?

Description

If you put the @deprecated directive on a mandatory field, cosmo builds the schema even though it shouldn't before the field is made optional (for schema compatibility)

apollo – GraphQLError: Required input field TestInput.testField cannot be deprecated.
graphql-schema-linter – Required input field TestInput.testField cannot be deprecated. (invalid-graphql-schema)
cosmo – OK, composite schema!

Steps to Reproduce

Initial scheme

input TestInput {
    testField: String!
}

Set the directive and expect an error during composition

input TestInput {
    testField: String! @deprecated
}

Cosmo doesn't cotton on to composition errors

Environment information

OS: 14.4 (23E214)
Package Manager: npm
Compiler(if manually compiled): go version go1.22.1 darwin/arm64

Router configuration

-

Router execution config

-

Log output

apollo:

GraphQLError: Required input field TestInput.testField cannot be deprecated.
      at Object.err (/builds/node_modules/@apollo/federation-internals/dist/error.js:11:32)
      at Validator.addError (/builds/node_modules/@apollo/federation-internals/dist/validate.js:100:57)
      at Validator.validateInputObjectType (/builds/node_modules/@apollo/federation-internals/dist/validate.js:188:22)
      at Validator.validate (/builds/node_modules/@apollo/federation-internals/dist/validate.js:64:26)
      at validateSchema (/builds/node_modules/@apollo/federation-internals/dist/validate.js:11:34)
      at Schema.validate (/builds/node_modules/@apollo/federation-internals/dist/definitions.js:1175:62)
      at Subgraph.validate (/builds/node_modules/@apollo/federation-internals/dist/federation.js:1129:25)
      at buildSubgraph (/builds/node_modules/@apollo/federation-internals/dist/federation.js:839:21)
      at subgraphsFromServiceList (/builds/node_modules/@apollo/federation-internals/dist/federation.js:1004:27)
      at Object.composeServices (/builds/node_modules/@apollo/composition/dist/compose.js:44:75) {
    message: '[test-service] Required input field TestInput.testField cannot be deprecated.',
    path: undefined,
    locations: [ [Object], [Object] ],
    extensions: { code: 'INVALID_GRAPHQL' }
  }

graphql-schema-linter:
Required input field TestInput.testField cannot be deprecated. (invalid-graphql-schema)

cosmo:
OK, composite schema!

@flymedllva flymedllva added the bug Something isn't working label Jun 26, 2024
Copy link

WunderGraph commits fully to Open Source and we want to make sure that we can help you as fast as possible.
The roadmap is driven by our customers and we have to prioritize issues that are important to them.
You can influence the priority by becoming a customer. Please contact us here.

@Aenimus
Copy link
Member

Aenimus commented Jun 26, 2024

Hi @flymedllva,

This is a known issue with a ticket in our backlog. We'll address it in due course.

Thanks,

The WunderGraph Team

@Aenimus Aenimus self-assigned this Jun 26, 2024
@Aenimus Aenimus added internally-reviewed The issue has been reviewed internally. confirmed bug The issue was replicated/determined to be a bug. and removed bug Something isn't working labels Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed bug The issue was replicated/determined to be a bug. internally-reviewed The issue has been reviewed internally.
Projects
None yet
Development

No branches or pull requests

2 participants