ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
5.22k stars 742 forks source link

BCP reports incorrect type. Expected "null" when an input variable is of type long? #6396

Open MattA48 opened 1 year ago

MattA48 commented 1 year ago

Is there an existing issue for this?

Product

Banana Cake Pop

Describe the bug

I have a schema with an input object which contains a field of type long?

When I enter a long value in GraphQL variables I have an amber error report stating 'Incorrect type. Expected "null"

Relevant type from schema: type SeriesDefinition { publishingSchedule: PublishingSchedule! getNextPublicationDueAfter(dateTimestamp: Long!): Long! nextPublicationDueDateFromToday: Long! nextPublicationDueDateFromLastPublished: Long! id: String! longName: String! appliesFrom: Long appliesUntil: Long publishingScheduleId: String! seriesScheduleExceptions: [ScheduleException!]! }

image

Steps to reproduce

https://github.com/glen-84/hc-6396 (.NET 8, BCP 14.0.0)

  1. Create a schema with mutation containing an object with field long?
  2. Import schema into BCP
  3. Attempt to fill out the mutation with a long value in the field

Relevant log output

No response

Additional Context?

No response

Version

8.0.2 MacOS

michaelstaib commented 1 year ago

Seems like a javascript limitation. This would also not serialize correctly and would also bring you into trouble with your frontend.

@rstaib @artola

MattA48 commented 1 year ago

OK we've not actually got to the point of using the FE with this, but we've used similar in other places without issue. What's the expected problem, the number is smaller than Number.MAX_SAFE_INTEGER, unless the handling of nullability causes other problems?

glen-84 commented 9 months ago

I added a minimal reproduction link to the initial comment.

Interestingly, if you change Long to Long!, then the error is:

Incorrect type. Expected "string".