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

type with then field cause deprecated warning in caliban-sbt #1031

Closed
ngbinh opened this issue Sep 6, 2021 · 7 comments · Fixed by #1032
Closed

type with then field cause deprecated warning in caliban-sbt #1031

ngbinh opened this issue Sep 6, 2021 · 7 comments · Fixed by #1032
Labels
good first issue Good for newcomers tools Issue related to Caliban tools like code generation or schema comparison

Comments

@ngbinh
Copy link
Contributor

ngbinh commented Sep 6, 2021

Using caliban-sbt on a schema with type like this:

type Order {
 then: String
}

would cause then is a reserved word (since 2.10.0); usage as an identifier is deprecated on the generated code.

is there a way to fix this?

Thanks

@ghostdogpr
Copy link
Owner

I think it might be enough just to add it to reservedKeywords here

I don't remember where I found the initial list of keywords but then was not in there.

@ghostdogpr ghostdogpr added good first issue Good for newcomers tools Issue related to Caliban tools like code generation or schema comparison labels Sep 6, 2021
@RhnSharma
Copy link
Contributor

I would like to take this one. Is it up for grabs?

@ghostdogpr
Copy link
Owner

Sure!

@ngbinh
Copy link
Contributor Author

ngbinh commented Sep 6, 2021

would be great if the list is configurable with sensible defaults.

@ghostdogpr
Copy link
Owner

In theory it's a finite list, but I can't find it. Even on the 2.13 language spec then is not included:
Screen Shot 2021-09-06 at 11 15 07 PM

@ngbinh
Copy link
Contributor Author

ngbinh commented Sep 6, 2021

then is reserved in dotty. More context here: scala/bug#10309

@ghostdogpr
Copy link
Owner

Oh, interesting, the error message is actually incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers tools Issue related to Caliban tools like code generation or schema comparison
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants