Skip to content

Fix Scala codegen emitting fields under names that don't match the schema#1008

Merged
trevor-scheer merged 3 commits intoapollographql:masterfrom
shadaj:scala-original-names
Feb 13, 2019
Merged

Fix Scala codegen emitting fields under names that don't match the schema#1008
trevor-scheer merged 3 commits intoapollographql:masterfrom
shadaj:scala-original-names

Conversation

@shadaj
Copy link
Copy Markdown
Contributor

@shadaj shadaj commented Feb 12, 2019

Fixes an oversight in the trait rewrite, since variable names in the generated traits determine the JS object that will be sent to Apollo but those variable names are transformed versions of the schema names, so there could be mismatches. This PR annotates the variables to tell Scala.js to emit those variables under the original schema names.

This can be included in a patch release, it doesn't have any breaking changes.

@shadaj shadaj force-pushed the scala-original-names branch 4 times, most recently from b5740db to 1c51ab4 Compare February 12, 2019 00:38
@shadaj shadaj force-pushed the scala-original-names branch from 1c51ab4 to 6445987 Compare February 12, 2019 00:39
@shadaj shadaj force-pushed the scala-original-names branch from 6b0f03d to 9fa2cc3 Compare February 12, 2019 23:57
Copy link
Copy Markdown
Contributor

@trevor-scheer trevor-scheer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just want to fix the any typings and this is good to go!

Comment thread packages/apollo-codegen-scala/src/codeGeneration.ts Outdated
@shadaj shadaj force-pushed the scala-original-names branch from 157a5dc to 915d070 Compare February 13, 2019 05:43
@trevor-scheer trevor-scheer merged commit 12cdd3c into apollographql:master Feb 13, 2019
@trevor-scheer
Copy link
Copy Markdown
Contributor

Thanks @shadaj!

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