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

Support fields in Live Query subscriptions #518

Merged
merged 1 commit into from
Dec 1, 2017

Conversation

TimNZ
Copy link
Contributor

@TimNZ TimNZ commented Dec 1, 2017

Use field keys specified via query.select() as fields value for subscribe.

Default fields of [className,objectId, createdAt, updatedAt, ACL] are always sent by server, which means the LQ subscribe message description for query.fields is inaccurate.

https://github.com/parse-community/parse-server/wiki/Parse-LiveQuery-Protocol-Specification#subscribe-message

I don't think ACL should be in the default fields but I don't know yet if it's used in the client somehow. Looking at that is another task.

@codecov
Copy link

codecov bot commented Dec 1, 2017

Codecov Report

Merging #518 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #518      +/-   ##
==========================================
+ Coverage   84.57%   84.58%   +0.01%     
==========================================
  Files          48       48              
  Lines        3947     3951       +4     
  Branches      895      897       +2     
==========================================
+ Hits         3338     3342       +4     
  Misses        609      609
Impacted Files Coverage Δ
...arse-community/Parse-SDK-JS/src/LiveQueryClient.js 87.27% <0%> (+0.31%) ⬆️

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 b27ff60...092b089. Read the comment docs.

@flovilmart
Copy link
Contributor

Perfect @TimNZ ! Just checked and you're 💯 parse-server supports the fields option from the get-go!

@flovilmart flovilmart merged commit 0d7cb39 into parse-community:master Dec 1, 2017
@montymxb
Copy link
Contributor

montymxb commented Dec 2, 2017

Thanks a ton @TimNZ !

@TimNZ
Copy link
Contributor Author

TimNZ commented Dec 2, 2017

I'm not a coder wizz but always interested in following best/popular practice

Would you have written:

let fields = queryJSON.keys ? queryJSON.keys.split(',') : undefined;

as

let fields = queryJSON.keys && queryJSON.keys.split(',')

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.

3 participants