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

Allow string inputs for Long Scalar type #1163

Merged

Conversation

jakobmerrild
Copy link
Contributor

Solves: #1162

Let me know if this is really something that should be solved in sangria-circe instead?

@yanns
Copy link
Contributor

yanns commented Dec 14, 2024

There's a compilation error with scala 2.12:

 [error] /home/runner/work/sangria/sangria/modules/core/src/main/scala/sangria/schema/package.scala:50:27: value toLongOption is not a member of String
[error] Error occurred in an application involving default arguments.
[error]       case s: String if s.toLongOption.isDefined => Right(s.toLong)
[error]                           ^
[error] /home/runner/work/sangria/sangria/modules/core/src/main/scala/sangria/schema/package.scala:57:48: value toLongOption is not a member of String
[error] Error occurred in an application involving default arguments.
[error]       case ast.StringValue(s, _, _, _, _) if s.toLongOption.isDefined => Right(s.toLong)
[error]                                                ^

The `.toLongOption` function isn't available in Scala 2.12
@jakobmerrild
Copy link
Contributor Author

I tried to create a specification for a custom Long scalar: graphql/graphql-scalars#26

@yanns yanns added this pull request to the merge queue Dec 16, 2024
Merged via the queue into sangria-graphql:main with commit e86440f Dec 16, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants