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

Fix: Serialize arrays as JSON on fetch in RESTDataSource #2219

Merged
merged 2 commits into from Feb 5, 2019

Conversation

aireyc1
Copy link

@aireyc1 aireyc1 commented Jan 23, 2019

Fixes issue introduced in #1125 and logged in #2186 and #2196.

Arrays are valid JSON per spec: https://tools.ietf.org/html/rfc7159

TODO:

  • Update CHANGELOG.md with your change (include reference to issue & this PR)
  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass

@apollo-cla
Copy link

@aireyc1: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

if (
options.body !== undefined &&
options.body !== null &&
(options.body.constructor === Object ||
options.body.constructor === Array ||
Copy link
Member

Choose a reason for hiding this comment

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

It's obviously not common to sub-class an Array, but could/should we switch this to use Array.isArray instead to help accommodate that?

Copy link
Author

Choose a reason for hiding this comment

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

@abernix Works for me. Updated.

Copy link
Member

@abernix abernix left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

Lerna will take care of this on publishing.
@abernix abernix merged commit 8b1b3d7 into apollographql:master Feb 5, 2019
@abernix abernix added this to the Release 2.4.0 milestone Feb 5, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants