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

Invalid @default validation rules #5436

Open
MacondoExpress opened this issue Aug 6, 2024 · 2 comments
Open

Invalid @default validation rules #5436

MacondoExpress opened this issue Aug 6, 2024 · 2 comments
Labels
bug report Something isn't working confirmed Confirmed bug

Comments

@MacondoExpress
Copy link
Contributor

Describe the bug

Current @default validation does not provide the correct error message for some typeDefs.

For instance:
Time issue:

type typeNode {
  time: Time @default(value: "10:00:00")
}

Raise the following error: "@default.value is not a valid Time" with a correct Time value.
The error in this case should be that Time is not supported.

DateTime case:
DateTime is a supported type, however, no validation rules happen for a List of DateTime values.

type typeNode {
  dateTimes: [DateTime] @default(value: ["dummy"])
}

The above, in fact, does not raise any error while dateTime: DateTime @default(value: "dummy") raise @default.value is not a valid DateTime.

Float case:
The Float type is supported, however, when not specifying the fraction part it raises an error:

type typeNode {
  float: Float @default(value: 1)
}

Raise the error: "@default.value on Float fields must be of type Float".
However, this is different from the GraphQL input specification:
https://spec.graphql.org/October2021/#sel-GAHXTHDCAACEB68G

System (please complete the following information):

@MacondoExpress MacondoExpress added the bug report Something isn't working label Aug 6, 2024
@neo4j-team-graphql
Copy link
Collaborator

Many thanks for raising this bug report @MacondoExpress. 🐛 We will now attempt to reproduce the bug based on the steps you have provided.

Please ensure that you've provided the necessary information for a minimal reproduction, including but not limited to:

  • Type definitions
  • Resolvers
  • Query and/or Mutation (or multiple) needed to reproduce

If you have a support agreement with Neo4j, please link this GitHub issue to a new or existing Zendesk ticket.

Thanks again! 🙏

@MacondoExpress MacondoExpress added the confirmed Confirmed bug label Aug 6, 2024
@neo4j-team-graphql
Copy link
Collaborator

We've been able to confirm this bug using the steps to reproduce that you provided - many thanks @MacondoExpress! 🙏 We will now prioritise the bug and address it appropriately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something isn't working confirmed Confirmed bug
Projects
Status: Confirmed
Development

No branches or pull requests

2 participants