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

Use ENV var to define default_comments_limit #5

Conversation

takahashim
Copy link
Collaborator

🎩 What? Why?

Rails.application.config.default_comments_limitを環境変数 DECIDIM_COMMENTS_LIMIT で上書きできるようにします。

📌 Related Issues

📋 Subtasks

  • Add documentation regarding the feature

(どこかに書いておいた方が良さそう?)

@takahashim
Copy link
Collaborator Author

ちなみにこれで送信しているGraphQLのクエリは↓こんな感じのようです…(これでもjqで整形済みなんですが、queryの値の文字列が大変長いので思い切りはみ出てます)。

{
  "operationName": "GetComments",
  "variables": {
    "commentableId": "8",
    "commentableType": "Decidim::Debates::Debate",
    "orderBy": "older",
    "singleCommentId": null,
    "locale": "ja",
    "toggleTranslations": false,
    "limit": 5
  },
  "query": "query GetComments($commentableId: String!, $commentableType: String!, $orderBy: String, $singleCommentId: String, $locale: String!, $toggleTranslations: Boolean!, $limit: Int) {\n  session {\n    user {\n      name\n      nickname\n      avatarUrl\n      organizationName\n      __typename\n    }\n    ...AddCommentFormSession\n    __typename\n  }\n  commentable(id: $commentableId, type: $commentableType, locale: $locale, toggleTranslations: $toggleTranslations) {\n    acceptsNewComments\n    userAllowedToComment\n    commentsHaveAlignment\n    commentsHaveVotes\n    totalCommentsCount\n    comments(orderBy: $orderBy, singleCommentId: $singleCommentId, limit: $limit) {\n      id\n      ...CommentThread\n      __typename\n    }\n    ...AddCommentFormCommentable\n    __typename\n  }\n}\n\nfragment AddCommentFormSession on Session {\n  verifiedUserGroups {\n    id\n    name\n    __typename\n  }\n  __typename\n}\n\nfragment CommentThread on Comment {\n  hasComments\n  ...Comment\n  __typename\n}\n\nfragment Comment on Comment {\n  ...CommentData\n  comments {\n    ...CommentData\n    comments {\n      ...CommentData\n      comments {\n        ...CommentData\n        __typename\n      }\n      __typename\n    }\n    __typename\n  }\n  __typename\n}\n\nfragment CommentData on Comment {\n  id\n  sgid\n  type\n  body\n  formattedBody\n  createdAt\n  formattedCreatedAt\n  author {\n    name\n    nickname\n    avatarUrl\n    profilePath\n    deleted\n    badge\n    __typename\n  }\n  hasComments\n  acceptsNewComments\n  userAllowedToComment\n  alignment\n  alreadyReported\n  ...UpVoteButton\n  ...DownVoteButton\n  __typename\n}\n\nfragment UpVoteButton on Comment {\n  id\n  upVotes\n  upVoted\n  downVoted\n  __typename\n}\n\nfragment DownVoteButton on Comment {\n  id\n  downVotes\n  downVoted\n  upVoted\n  __typename\n}\n\nfragment AddCommentFormCommentable on Commentable {\n  id\n  type\n  __typename\n}\n"
}

@ayuki-joto ayuki-joto merged commit 6e54a4c into ayuki-joto:feature/update-decidim_v0.23.5 Sep 17, 2021
@takahashim takahashim deleted the comments-limit-initializer branch September 17, 2021 04:51
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.

2 participants