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

Add Pagination to schema #2108

Closed
appetrosyan opened this issue Apr 15, 2022 · 1 comment
Closed

Add Pagination to schema #2108

appetrosyan opened this issue Apr 15, 2022 · 1 comment
Assignees
Labels
iroha2-dev The re-implementation of a BFT hyperledger in RUST

Comments

@appetrosyan
Copy link
Contributor

Add pagination to schema, so that SDKs can make paginated queries.

@appetrosyan appetrosyan added the iroha2-dev The re-implementation of a BFT hyperledger in RUST label Apr 15, 2022
@appetrosyan appetrosyan self-assigned this Apr 15, 2022
@appetrosyan
Copy link
Contributor Author

[In reply to Aleksandr Petrosyan]
Да. Например, приходит 10 ассетов, но хорошо бы понимать, что вообще их 600 штук

Aleksandr Petrosyan, [19.04.22 10:48]
Попробую добавить.

Aleksandr Petrosyan, [19.04.22 11:14]
Так, тут не всё просто. У каждой квери есть поддержка пагинации, и свой выводной тип. 
В выводном типе в векторе можно добавить поле total, и это может облегчить работу.

Bogdan Mingela, [19.04.22 11:20]
[In reply to Aleksandr Petrosyan]
А не лучше атрибуты самой пагинации расширить, если они есть в ответе? Чем каждый тип расширять 🤔

Dima Balashov, [19.04.22 11:26]
[In reply to Aleksandr Petrosyan]
Можно ли возвращать какую-то обёртку, вроде Paginated<T>, где будут данные T и сведения о пагинации?

Aleksandr Petrosyan, [19.04.22 11:27]
[In reply to Dima Balashov]
Можно.

Aleksandr Petrosyan, [19.04.22 11:28]
[In reply to Bogdan Mingela]
Их нет в ответе. Это было бы проще.

Aleksandr Petrosyan, [19.04.22 11:29]
Последний вариант, это договориться что если Кверя пагинированная, то первый ValueBox в возвращаемом Vec будет размером общего.

Bogdan Mingela, [19.04.22 11:30]
[In reply to Dima Balashov]
Я тоже предполагаю ответ формата по типу
PagedResult{
PageMeta{
PageNum,
PageSize,
TotalSize
},
ResultData: [Token1, Token2..]
}
Но тут уж на свое усмотрение, просто вброс

appetrosyan added a commit to appetrosyan/iroha that referenced this issue May 4, 2022
appetrosyan added a commit to appetrosyan/iroha that referenced this issue May 12, 2022
appetrosyan added a commit to appetrosyan/iroha that referenced this issue May 12, 2022
appetrosyan added a commit to appetrosyan/iroha that referenced this issue May 12, 2022
appetrosyan added a commit to appetrosyan/iroha that referenced this issue May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iroha2-dev The re-implementation of a BFT hyperledger in RUST
Projects
None yet
Development

No branches or pull requests

1 participant