Skip to content

Support Fetch With Include #631

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

Merged
merged 6 commits into from
Aug 12, 2018
Merged

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Aug 10, 2018

Added fetchWithInclude and fetchAllWithInclude to Parse Object.

Added fetchWithInclude to User

As discussed parse-community/parse-server#4845 (comment)

@codecov
Copy link

codecov bot commented Aug 10, 2018

Codecov Report

Merging #631 into master will increase coverage by 0.41%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #631      +/-   ##
==========================================
+ Coverage   85.12%   85.53%   +0.41%     
==========================================
  Files          48       48              
  Lines        3865     3899      +34     
  Branches      871      882      +11     
==========================================
+ Hits         3290     3335      +45     
+ Misses        575      564      -11
Impacted Files Coverage Δ
src/RESTController.js 85.03% <ø> (ø) ⬆️
src/ParseObject.js 88.44% <100%> (+1.78%) ⬆️
src/ParseUser.js 67.86% <100%> (+0.67%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ceb34c5...732273b. Read the comment docs.

@dplewis dplewis requested a review from flovilmart August 10, 2018 15:08
* @param {Object} options
* @static
*/
static fetchAllWithInclude(list: Array<ParseObject>, keys: String|Array<string|Array<string>>, options: RequestOptions) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we add more things like those warppers? semms un necessary if it's properly documented in the RequestOptions.

Copy link
Member Author

@dplewis dplewis Aug 10, 2018

Choose a reason for hiding this comment

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

I'm sorry I'm not following. How should it be?

I like shorthand but we could leave it like

obj.fetch({ include: ['key1', 'key2',...] })

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, that was my point, but we can keep the nice interfaces also, i don’t mind

@dplewis dplewis requested a review from flovilmart August 10, 2018 22:06
@dplewis
Copy link
Member Author

dplewis commented Aug 12, 2018

@flovilmart I added documentation for the RequestOptions to handle include

@flovilmart
Copy link
Contributor

There was one small nit :)

@dplewis
Copy link
Member Author

dplewis commented Aug 12, 2018

Nit? Where?

return CoreManager.getObjectController().fetch(
list,
true,
queryOptions
);
}

/**
Copy link
Contributor

Choose a reason for hiding this comment

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

Small nit: remove one space

Copy link
Contributor

Choose a reason for hiding this comment

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

Here. Sorry, forgot to hit ‘comment’ at the end of the review

Copy link
Member Author

Choose a reason for hiding this comment

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

Can we add eslint to this project at some point? It looks like it would be a lot of work tho :/

Copy link
Contributor

Choose a reason for hiding this comment

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

Nobody will ever hate you for adding it.

@adanski
Copy link

adanski commented Jan 13, 2019

Is this change documented?

@dplewis
Copy link
Member Author

dplewis commented Jan 13, 2019

https://parseplatform.org/Parse-SDK-JS/api/2.1.0/Parse.Object.html#fetchWithInclude

If you want to update the guide feel free to open a PR

@espipj
Copy link

espipj commented Oct 18, 2020

Hello @dplewis is there any way by using fetchWithInclude to fetch all the Children objects? Something like fetchWithIncludeAll or fetchWithInclude('*')?

@dplewis
Copy link
Member Author

dplewis commented Oct 18, 2020

You should be able to pass in ‘*’

@espipj
Copy link

espipj commented Oct 19, 2020

Hey @dplewis thanks for the help! That worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants