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

Add fallback to Object in case if there is no custom scalar type mapping specified #177

Conversation

sav007
Copy link
Contributor

@sav007 sav007 commented Feb 9, 2017

Closes #173

If user didn't specify custom type mapping, Object will be used as java type for fields with GraphQL custom scalar.
As for the parsing response values for such fields it will be decided by json reader, that supports by default only 3 types: Boolean, String, BigDecimal.

@sav007
Copy link
Contributor Author

sav007 commented Feb 9, 2017

@martinbonnin
Copy link
Contributor

Thanks :)

@digitalbuddha
Copy link
Contributor

you can start tagging @brianPlummer for reviews as well fyi.

case 3: {
contentValues.fieldWithUnsupportedType = (Object) value;
break;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

would be good to have a default label...nitpick

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry what do you mean?

Copy link
Contributor

Choose a reason for hiding this comment

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

A default case to the switch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agh, well this code is generated, so we guarantee that there won't be default case

Copy link
Contributor

Choose a reason for hiding this comment

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

gotcha! :)

@sav007 sav007 merged commit c77bf2f into apollographql:master Feb 10, 2017
@sav007 sav007 deleted the feature-173/unsupported-custom-scalar-types branch February 10, 2017 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants