Skip to content

Coercing exception handling - #487

Merged
bbakerman merged 2 commits into
masterfrom
scalars-work
Jun 14, 2017
Merged

bbakerman merged 2 commits into
masterfrom
scalars-work

Conversation

@andimarek

@andimarek andimarek commented Jun 5, 2017 •

Copy link
Copy Markdown
Member

This PR introduces two different GraphQLException for Coercing serialize/parseValue.

It handles enum values serialization and scalars serialization correctly by catching the exception, adding an Error and setting the value to null.

It is a breaking change, because some protected methods ins ExecutionStrategy are changed including the logic (not sure if the logic changes classifie as bug fix or not)

andimarek added 2 commits June 5, 2017 12:37
handle serialize exception in ExecutionStrategy
enum serialization exceptions are handled correctly
@andimarek andimarek added the breaking change requires a new major version to be relased label Jun 5, 2017
@andimarek andimarek added this to the 4.0.0 milestone Jun 5, 2017
@andimarek
andimarek requested a review from bbakerman June 5, 2017 11:19

@bbakerman bbakerman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Its a nitpick on the parameter ordering but otherwise looks good

return result;
}

protected ExecutionResult completeValueForEnum(GraphQLEnumType enumType, ExecutionStrategyParameters parameters, Object result) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we make the signature
protected ExecutionResult completeValueForEnum(GraphQLEnumType enumType, ExecutionContext
context, ExecutionStrategyParameters parameters, Object result) {

That way its sympathetic to the other methods that have ExecutionContext
context, ExecutionStrategyParameters parameters as parameters

In fact you could argue for consistency they should be the 1st two parameters (since this is a breaking change)

@bbakerman

Copy link
Copy Markdown
Member

Since it was only a nitpick I would rather get this in an do a 2nd PR to fix up the nitpick

@bbakerman
bbakerman merged commit deedb88 into master Jun 14, 2017
@andimarek

Copy link
Copy Markdown
Member Author

@bbakerman 👍

@andimarek
andimarek deleted the scalars-work branch June 18, 2017 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change requires a new major version to be relased

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants