添加了 skip,contains,addAscending, addDescending 几个查询条件#7
Open
brucx wants to merge 4 commits intoleancloud:masterfrom
Open
添加了 skip,contains,addAscending, addDescending 几个查询条件#7brucx wants to merge 4 commits intoleancloud:masterfrom
brucx wants to merge 4 commits intoleancloud:masterfrom
Conversation
Contributor
|
skip 和 contains 其实都是我故意没有添加的,原因是它们都会导致查询的性能变得非常查,而对于大部分场景来说,它们又不是必须的,所以也不打算添加。 你添加 addAscending 和 addDescending 的目的是为了支持更多的排序字段么?如果是这样的话加一个 addAscending 也只是能增加 一个 额外的排序字段而已,我觉得可能更好的做法是把 ascending 改成一个 Union Type,同时支持 FieldEnum(单个排序条件)和 [FieldEnum](数组,多个排序条件)。 |
Author
|
告知清楚利弊,选择留给用户?毕竟在表不大的情况下,用skip配合limit分页查询是很简单的,同时性能也能够接受。 使用ascending或者descending似乎不能实现先按属性a升序、再按b降序、再按c升序这样的需求,这样的需求在后台管理还是会遇到的。 |
Contributor
|
skip 和 contains 我还是不打算加。 如果要这样排序的话,添加 addAscending 应该也不能解决,GraphQL 查询参数的各项之间应该是没有顺序之分的。可能要支持类似 CQL |
xyqfer
added a commit
to xyqfer/leancloud-graphql
that referenced
this pull request
Oct 7, 2019
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.
No description provided.