Fetch relationships in parallel#13
Merged
Merged
Conversation
agarzola
commented
Sep 2, 2018
| @@ -0,0 +1,12 @@ | |||
| module.exports = { | |||
| type: 'blockquote', | |||
| id: '104', | |||
Member
Author
There was a problem hiding this comment.
Ideally, in the future, both the type and the id would be omitted from these files. The mocking module would insert these values automatically by convention. That would help make things just a bit DRYer.
Member
Author
There was a problem hiding this comment.
Update: this whole json:api mocking function has been extracted into jsonapilite (named after sqlite) and expanded a bit to support the needs of #14. That extraction occurs in the branch for #14, which is based off of this branch.
3 tasks
This is missing test data for the field and relationship endpoints, and will likely require a refactor of test data to break things apart.
And remove unused tests
254ebe0 to
6e02914
Compare
|
👍 talked through this with @agarzola and all of the changes look good to me. |
markdorison
approved these changes
Oct 17, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As outlined in #9,
json:apiallows fetching a related object via/:type/:id/:field_nameand the relationship itself via/:type/:id/relationships/:field_name. This PR implements optionally fetching related objects and relationships using these endpoints via parallel requests.In order to test this, I needed to mock up fetching these smaller subsets of data, so the rudimentary JSON file would not cut it. An API mocking function takes a request object and uses the file system to construct a
json:api-compliant response. It supports relationships via query string parameters and via the URLs specified above.This is best reviewed on a per-commit basis.