Skip to content

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

Merged
abernix merged 2 commits into
apollographql:masterfrom
aireyc1:fix-fetch-json-array
Feb 5, 2019
Merged

Fix: Serialize arrays as JSON on fetch in RESTDataSource#2219
abernix merged 2 commits into
apollographql:masterfrom
aireyc1:fix-fetch-json-array

Conversation

@aireyc1

@aireyc1 aireyc1 commented Jan 23, 2019

Copy link
Copy Markdown

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
Copy Markdown

@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/

@aireyc1 aireyc1 force-pushed the fix-fetch-json-array branch from 0cf836f to c37f781 Compare January 23, 2019 21:59
options.body !== undefined &&
options.body !== null &&
(options.body.constructor === Object ||
options.body.constructor === Array ||

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.

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
Copy Markdown
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.

@aireyc1 aireyc1 force-pushed the fix-fetch-json-array branch from c37f781 to 74c7627 Compare February 5, 2019 08:35
@aireyc1 aireyc1 force-pushed the fix-fetch-json-array branch from 74c7627 to e8e4902 Compare February 5, 2019 08:38

@abernix abernix 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.

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.

4 participants