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

Change how post are responded #498

Closed
dadamu opened this issue Jun 18, 2021 · 1 comment · Fixed by #499
Closed

Change how post are responded #498

dadamu opened this issue Jun 18, 2021 · 1 comment · Fixed by #499
Labels
kind/enhancement Enhance an already existing feature; no "New feature" to add x/posts Post module
Milestone

Comments

@dadamu
Copy link
Contributor

dadamu commented Jun 18, 2021

Feature description

In current version, the post response returns whole content includes all the PostReactions and UserAnswers. In my opinion, both of them in PostResponse could be replaced with the total count. As a result, the post response will be much smaller and much more fast when querying. Then, PostReactions can also be paginated when querying whole reactions of the post.

Implementation proposal

Change the post response struct, say:

message QueryPostResponse {
  desmos.posts.v1beta1.Post post = 1;

  // Answers field show the total count of each answers from user
  map<string, int> answers = 2;

  // Reactions field shows the total count of each reactions from user 
  map<string, int> reactions = 3;

  repeated string children = 4;
}

Thoughts on it? @RiccardoM @bragaz

@dadamu dadamu added kind/enhancement Enhance an already existing feature; no "New feature" to add x/posts Post module labels Jun 18, 2021
@RiccardoM
Copy link
Contributor

RiccardoM commented Jun 18, 2021

I think we can simply delete all the different things that are not the Post itself. Developers will be able to use the other gRPC queries to get the data anyway. So the final response can simply be

message QueryPostResponse {
  desmos.posts.v1beta1.Post post = 1;
}

Notes

If not already present, we should add the following queries: GetPostReactions (paginated) and GetPostChildren (paginated)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Enhance an already existing feature; no "New feature" to add x/posts Post module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants