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

Marking a query field argument as no longer mandatory is considered a breaking change #2067

Open
Tracked by #2441
klippx opened this issue Jan 19, 2022 · 1 comment

Comments

@klippx
Copy link

klippx commented Jan 19, 2022

Graphql Inspector says that:
✖ Type for argument transactions on field Query.transactions changed from [TransactionIdentifier!]! to [TransactionIdentifier!]

To Reproduce

Checked in schema:

const Schema = gql`
  type Query {
    "The transactions query is the general no-frills transactions search."
    transactions(
      "Use this parameter to limit the search to the specified TransactionIdentifier objects (limited to 50 per request)"
      transactions: [TransactionIdentifier!]!
    ): Transactions!
  }
`

New schema:

const Schema = gql`
  type Query {
    "The transactions query is the general no-frills transactions search."
    transactions(
      "Use this parameter to limit the search to the specified TransactionIdentifier objects (limited to 50 per request)"
      transactions: [TransactionIdentifier!]
    ): Transactions!
  }
`

Expected behavior

No breaking changes detected

Environment:

  • OS: MacOS 12.1
  • @graphql-inspector/...: 2.9.0
  • graphql: 15.8.0
  • NodeJS: v12.18.4 (monorepo, dont look at me 😁 )

Additional context

@filipncs
Copy link
Contributor

filipncs commented Aug 3, 2022

This appears to now be fixed, could you try again?

Your schemas are not valid in isolation, but the following similar schemas now give the expected behaviour (on 3.3.0).

Old:

input TransactionIdentifier  {
  internal: String!
}

type Query {
  transactions(transactions: [TransactionIdentifier!]!): String
}

New:

input TransactionIdentifier  {
  internal: String!
}

type Query {
  transactions(transactions: [TransactionIdentifier!]): String
}

Result:

✔  Type for argument transactions on field Query.transactions changed from [TransactionIdentifier!]! to [TransactionIdentifier!]
success No breaking changes detected

@theguild-bot theguild-bot mentioned this issue Apr 16, 2023
39 tasks
@theguild-bot theguild-bot mentioned this issue Oct 26, 2023
38 tasks
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