Skip to main content

ํ† ๋ก ์— GraphQL API ์‚ฌ์šฉ

GitHub Discussions GraphQL API๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ์•„๋ด…๋‹ˆ๋‹ค.

GitHub Discussions GraphQL API๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ํ† ๋ก  ๊ฒŒ์‹œ๋ฌผ์„ ๋‹ค์šด๋กœ๋“œ, ์ƒ์„ฑ, ํŽธ์ง‘, ์‚ญ์ œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. GitHub Discussions์— ๋Œ€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ ํ† ๋ก  ์ •๋ณด์„(๋ฅผ) ์ฐธ์กฐํ•˜์„ธ์š”.

์ด API๋Š” ์ธ์ฆ๋œ ์‚ฌ์šฉ์ž, OAuth apps ๋ฐ GitHub ์•ฑ์— ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์•ก์„ธ์Šค ํ† ํฐ์—๋Š” ํ”„๋ผ์ด๋น— ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์˜ repo ๋ฒ”์œ„์™€ ํผ๋ธ”๋ฆญ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์˜ public_repo ๋ฒ”์œ„๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ OAuth ์•ฑ์— ๋Œ€ํ•œ ๋ฒ”์œ„์„(๋ฅผ) ์ฐธ์กฐํ•˜์„ธ์š”.

ํ•„๋“œ

Repository.discussions

๋ฆฌํฌ์ง€ํ† ๋ฆฌ ๋‚ด์˜ ํ† ๋ก ์„ ๋‚˜์—ดํ•ฉ๋‹ˆ๋‹ค. categoryId๋ฅผ ์ง€์ •ํ•˜๋ฉด ํ•ด๋‹น ๋ฒ”์ฃผ ๋‚ด์˜ ๊ฒฐ๊ณผ๋งŒ ๋ฐ˜ํ™˜๋ฉ๋‹ˆ๋‹ค. answered๋ฅผ ์ง€์ •ํ•˜์ง€ ์•Š์œผ๋ฉด ๋‹ต๋ณ€๋œ ํ† ๋ก  ๋ฐ ๋‹ต๋ณ€๋˜์ง€ ์•Š์€ ํ† ๋ก ์ด ๋ชจ๋‘ ๋ฐ˜ํ™˜๋ฉ๋‹ˆ๋‹ค.

์„œ๋ช…:__

discussions(
  after: String,
  before: String,
  first: Int,
  last: Int,
  categoryId: ID = null,
  
  answered: Boolean = null,
  
  orderBy: DiscussionOrder = {field: UPDATED_AT, direction: DESC}
) : Discussion

DiscussionOrder

"""
Ways in which discussions can be ordered.
"""
input DiscussionOrder {
  """
  The field by which to order discussions.
  """
  field: DiscussionOrderField!

  """
  The direction in which to order discussions by the specified field.
  """
  direction: OrderDirection!
}
"""
Properties by which discussion connections can be ordered.
"""
enum DiscussionOrderField {
  """
  Order discussions by creation time.
  """
  CREATED_AT

  """
  Order discussions by most recent modification time.
  """
  UPDATED_AT
}

Repository.discussionCategories

์ด ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ๋‚ด์— ์ •์˜๋œ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ํ† ๋ก  ๋ฒ”์ฃผ๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์—๋Š” ์ตœ๋Œ€ 25๊ฐœ์˜ ๋ฒ”์ฃผ๊ฐ€ ์žˆ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ† ๋ก  ๋ฒ”์ฃผ์— ๊ด€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ ํ† ๋ก  ์ •๋ณด์„(๋ฅผ) ์ฐธ์กฐํ•˜์„ธ์š”.

์„œ๋ช…:__

discussionCategories(
  after: String,
  before: String,
  first: Int,
  last: Int,
) : DiscussionCategoryConnection!

Repository.discussion

ํ† ๋ก ์„ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค. ์ง€์ •๋œ ID๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ํ† ๋ก ์ด ์—†๋Š” ๊ฒฝ์šฐ null์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

์„œ๋ช…:__

discussion(number: Int!) : Discussion

Repository.pinnedDiscussions

์ด ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์— ๊ณ ์ •๋œ ํ† ๋ก ์„ ๊ณ ์ • ์œ„์น˜๋กœ ์ •๋ ฌํ•˜์—ฌ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

์„œ๋ช…:__

pinnedDiscussions(
  after: String,
  before: String,
  first: Int,
  last: Int,
) : PinnedDiscussionConnection!

๊ฐœ์ฒด

์ฐธ๊ณ : ๊ฐ„๋‹จํžˆ ๋งํ•˜๋ฉด ์—ฐ๊ฒฐ ํ˜•์‹์€ ์—ฌ๊ธฐ์„œ ํ™•์žฅ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์Šคํ‚ค๋งˆ์—์„œ ์–ธ๊ธ‰๋œ ๊ฐ ์—ฐ๊ฒฐ ํ˜•์‹์€ GraphQL API์˜ ๋‹ค๋ฅธ ์—ฐ๊ฒฐ๊ณผ ๋™์ผํ•œ ํŒจํ„ด์„ ๋”ฐ๋ฆ…๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ GraphQL ์†Œ๊ฐœ์„(๋ฅผ) ์ฐธ์กฐํ•˜์„ธ์š”.

query {
  repository(owner: "github", name: "some-repo") {
    discussions(first: 10) {
      # type: DiscussionConnection
      totalCount # Int!

      pageInfo {
        # type: PageInfo (from the public schema)
        startCursor
        endCursor
        hasNextPage
        hasPreviousPage
      }

      edges {
        # type: DiscussionEdge
        cursor
        node {
          # type: Discussion
          id
        }
      }

      nodes {
        # type: Discussion
        id
      }
    }
  }
}

ํ† ๋ก (Discussion)

ํ•„๋“œ:
"""
A discussion in a repository.
"""
type Discussion implements Comment & Deletable & Lockable & Node & Reactable & RepositoryNode & Subscribable & Updatable {
  """
  Reason that the conversation was locked.
  """
  activeLockReason: LockReason

  
  """
  Check if this discussion has been answered
  """
  isAnswered: Boolean!
  

  """
  The comment chosen as this discussion's answer, if any.
  """
  answer: DiscussionComment

  """
  The time when a user chose this discussion's answer, if answered.
  """
  answerChosenAt: DateTime

  """
  The user who chose this discussion's answer, if answered.
  """
  answerChosenBy: Actor

  """
  The actor who authored the comment.
  """
  author: Actor

  """
  Author's association with the subject of the comment.
  """
  authorAssociation: CommentAuthorAssociation!

  """
  The main text of the discussion post.
  """
  body: String!

  """
  The body rendered to HTML.
  """
  bodyHTML: HTML!

  """
  The body rendered to text.
  """
  bodyText: String!

  """
  The category for this discussion.
  """
  category: DiscussionCategory!

  """
  The replies to the discussion.
  """
  comments(
    """
    Returns the elements in the list that come after the specified cursor.
    """
    after: String

    """
    Returns the elements in the list that come before the specified cursor.
    """
    before: String

    """
    Returns the first _n_ elements from the list.
    """
    first: Int

    """
    Returns the last _n_ elements from the list.
    """
    last: Int
  ): DiscussionCommentConnection!

  """
  Identifies the date and time when the object was created.
  """
  createdAt: DateTime!

  """
  Check if this comment was created via an email reply.
  """
  createdViaEmail: Boolean!

  """
  Identifies the primary key from the database.
  """
  databaseId: Int

  """
  The actor who edited the comment.
  """
  editor: Actor
  id: ID!

  """
  Check if this comment was edited and includes an edit with the creation data
  """
  includesCreatedEdit: Boolean!

  """
  The moment the editor made the last edit
  """
  lastEditedAt: DateTime

  """
  `true` if the object is locked
  """
  locked: Boolean!

  """
  The number identifying this discussion within the repository.
  """
  number: Int!

  """
  Identifies when the comment was published at.
  """
  publishedAt: DateTime

  """
  A list of reactions grouped by content left on the subject.
  """
  reactionGroups: [ReactionGroup!]

  """
  A list of Reactions left on the Issue.
  """
  reactions(
    """
    Returns the elements in the list that come after the specified cursor.
    """
    after: String

    """
    Returns the elements in the list that come before the specified cursor.
    """
    before: String

    """
    Allows filtering Reactions by emoji.
    """
    content: ReactionContent

    """
    Returns the first _n_ elements from the list.
    """
    first: Int

    """
    Returns the last _n_ elements from the list.
    """
    last: Int

    """
    Allows specifying the order in which reactions are returned.
    """
    orderBy: ReactionOrder
  ): ReactionConnection!

  """
  The repository associated with this node.
  """
  repository: Repository!

  """
  The path for this discussion.
  """
  resourcePath: URI!

  """
  The title of this discussion.
  """
  title: String!

  """
  Identifies the date and time when the object was last updated.
  """
  updatedAt: DateTime!

  """
  The URL for this discussion.
  """
  url: URI!

  """
  A list of edits to this content.
  """
  userContentEdits(
    """
    Returns the elements in the list that come after the specified cursor.
    """
    after: String

    """
    Returns the elements in the list that come before the specified cursor.
    """
    before: String

    """
    Returns the first _n_ elements from the list.
    """
    first: Int

    """
    Returns the last _n_ elements from the list.
    """
    last: Int
  ): UserContentEditConnection

  """
  Check if the current viewer can delete this object.
  """
  viewerCanDelete: Boolean!

  """
  Can user react to this subject
  """
  viewerCanReact: Boolean!

  """
  Check if the viewer is able to change their subscription status for the repository.
  """
  viewerCanSubscribe: Boolean!

  """
  Check if the current viewer can update this object.
  """
  viewerCanUpdate: Boolean!

  """
  Did the viewer author this comment.
  """
  viewerDidAuthor: Boolean!

  """
  Identifies if the viewer is watching, not watching, or ignoring the subscribable entity.
  """
  viewerSubscription: SubscriptionState
}

DiscussionComment

ํ•„๋“œ
"""
A comment on a discussion.
"""
type DiscussionComment implements Comment & Deletable & Minimizable & Node & Reactable & Updatable & UpdatableComment {
  """
  The actor who authored the comment.
  """
  author: Actor

  """
  Author's association with the subject of the comment.
  """
  authorAssociation: CommentAuthorAssociation!

  """
  The body as Markdown.
  """
  body: String!

  """
  The body rendered to HTML.
  """
  bodyHTML: HTML!

  """
  The body rendered to text.
  """
  bodyText: String!

  """
  Identifies the date and time when the object was created.
  """
  createdAt: DateTime!

  """
  Check if this comment was created via an email reply.
  """
  createdViaEmail: Boolean!

  """
  Identifies the primary key from the database.
  """
  databaseId: Int

  """
  The time when this replied-to comment was deleted
  """
  deletedAt: DateTime

  """
  The discussion this comment was created in
  """
  discussion: Discussion

  """
  The actor who edited the comment.
  """
  editor: Actor
  id: ID!

  """
  Check if this comment was edited and includes an edit with the creation data
  """
  includesCreatedEdit: Boolean!

  """
  Has this comment been chosen as the answer of its discussion?
  """
  isAnswer: Boolean!

  """
  Returns whether or not a comment has been minimized.
  """
  isMinimized: Boolean!

  """
  The moment the editor made the last edit
  """
  lastEditedAt: DateTime

  """
  Returns why the comment was minimized.
  """
  minimizedReason: String

  """
  Identifies when the comment was published at.
  """
  publishedAt: DateTime

  """
  A list of reactions grouped by content left on the subject.
  """
  reactionGroups: [ReactionGroup!]

  """
  A list of Reactions left on the Issue.
  """
  reactions(
    """
    Returns the elements in the list that come after the specified cursor.
    """
    after: String

    """
    Returns the elements in the list that come before the specified cursor.
    """
    before: String

    """
    Allows filtering Reactions by emoji.
    """
    content: ReactionContent

    """
    Returns the first _n_ elements from the list.
    """
    first: Int

    """
    Returns the last _n_ elements from the list.
    """
    last: Int

    """
    Allows specifying the order in which reactions are returned.
    """
    orderBy: ReactionOrder
  ): ReactionConnection!

  """
  The threaded replies to this comment.
  """
  replies(
    """
    Returns the elements in the list that come after the specified cursor.
    """
    after: String

    """
    Returns the elements in the list that come before the specified cursor.
    """
    before: String

    """
    Returns the first _n_ elements from the list.
    """
    first: Int

    """
    Returns the last _n_ elements from the list.
    """
    last: Int
  ): DiscussionCommentConnection!

  """
  The discussion comment this comment is a reply to
  """
  replyTo: DiscussionComment

  """
  The path for this discussion comment.
  """
  resourcePath: URI!

  """
  Identifies the date and time when the object was last updated.
  """
  updatedAt: DateTime!

  """
  The URL for this discussion comment.
  """
  url: URI!

  """
  A list of edits to this content.
  """
  userContentEdits(
    """
    Returns the elements in the list that come after the specified cursor.
    """
    after: String

    """
    Returns the elements in the list that come before the specified cursor.
    """
    before: String

    """
    Returns the first _n_ elements from the list.
    """
    first: Int

    """
    Returns the last _n_ elements from the list.
    """
    last: Int
  ): UserContentEditConnection

  """
  Check if the current viewer can delete this object.
  """
  viewerCanDelete: Boolean!

  """
  Can the current user mark this comment as an answer?
  """
  viewerCanMarkAsAnswer: Boolean!

  """
  Check if the current viewer can minimize this object.
  """
  viewerCanMinimize: Boolean!

  """
  Can user react to this subject
  """
  viewerCanReact: Boolean!

  """
  Can the current user unmark this comment as an answer?
  """
  viewerCanUnmarkAsAnswer: Boolean!

  """
  Check if the current viewer can update this object.
  """
  viewerCanUpdate: Boolean!

  """
  Reasons why the current viewer can not update this comment.
  """
  viewerCannotUpdateReasons: [CommentCannotUpdateReason!]!

  """
  Did the viewer author this comment.
  """
  viewerDidAuthor: Boolean!
}

DiscussionCategory

ํ•„๋“œ
"""
A category for discussions in a repository.
"""
type DiscussionCategory implements Node & RepositoryNode {
  """
  Identifies the date and time when the object was created.
  """
  createdAt: DateTime!

  """
  A description of this category.
  """
  description: String

  """
  An emoji representing this category.
  """
  emoji: String!

  """
  This category's emoji rendered as HTML.
  """
  emojiHTML: HTML!
  id: ID!

  """
  Whether or not discussions in this category support choosing an answer with the markDiscussionCommentAsAnswer mutation.
  """
  isAnswerable: Boolean!

  """
  The name of this category.
  """
  name: String!

  """
  The repository associated with this node.
  """
  repository: Repository!

  """
  Identifies the date and time when the object was last updated.
  """
  updatedAt: DateTime!
}

PinnedDiscussion

ํ•„๋“œ:
"""
A Pinned discussion is a discussion pinned to a repository's index page.
"""
type PinnedDiscussion implements Node & RepositoryNode {
  """
  Identifies the date and time when the object was created.
  """
  createdAt: DateTime!

  """
  Identifies the primary key from the database.
  """
  databaseId: Int

  """
  The discussion that was pinned.
  """
  discussion: Discussion!

  """
  Color stops of the chosen gradient
  """
  gradientStopColors: [String!]!
  id: ID!

  """
  Background texture pattern
  """
  pattern: PinnedDiscussionPattern!

  """
  The actor that pinned this discussion.
  """
  pinnedBy: Actor!

  """
  Preconfigured background gradient option
  """
  preconfiguredGradient: PinnedDiscussionGradient

  """
  The repository associated with this node.
  """
  repository: Repository!

  """
  Identifies the date and time when the object was last updated.
  """
  updatedAt: DateTime!
}

PinnedDiscussionPattern

๊ฐ’
"""
Preconfigured background patterns that may be used to style discussions pinned within a repository.
"""
enum PinnedDiscussionPattern {
  """
  An upward-facing chevron pattern
  """
  CHEVRON_UP

  """
  A hollow dot pattern
  """
  DOT

  """
  A solid dot pattern
  """
  DOT_FILL

  """
  A heart pattern
  """
  HEART_FILL

  """
  A friendly octocat face pattern
  """
  OCTOFACE

  """
  A plus sign pattern
  """
  PLUS
}

PinnedDiscussionGradient

๊ฐ’
"""
Preconfigured gradients that may be used to style discussions pinned within a repository.
"""
enum PinnedDiscussionGradient {
  """
  A gradient of blue to mint
  """
  BLUE_MINT

  """
  A gradient of blue to purple
  """
  BLUE_PURPLE

  """
  A gradient of pink to blue
  """
  PINK_BLUE

  """
  A gradient of purple to coral
  """
  PURPLE_CORAL

  """
  A gradient of red to orange
  """
  RED_ORANGE
}

์ธํ„ฐํŽ˜์ด์Šค

RepositoryDiscussionAuthor

User ๋ฐ Organization ํ˜•์‹์— ์˜ํ•ด ๊ตฌํ˜„๋ฉ๋‹ˆ๋‹ค. ์ฐธ๊ณ : Organization์€ User๋กœ๋ถ€ํ„ฐ ๋ณ€ํ™˜๋œ ๊ฒฝ์šฐ์—๋งŒ ๊ด€๋ จ ํ† ๋ก ์„ ๊ฐ–๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

ํ•„๋“œ
"""
Represents an author of discussions in repositories.
"""
interface RepositoryDiscussionAuthor {
  """
  Discussions this user has started.
  """
  repositoryDiscussions(
    """
    Returns the elements in the list that come after the specified cursor.
    """
    after: String

    """
    Filter discussions to only those that have been answered or not. Defaults to
    including both answered and unanswered discussions.
    """
    answered: Boolean = null

    """
    Returns the elements in the list that come before the specified cursor.
    """
    before: String

    """
    Returns the first _n_ elements from the list.
    """
    first: Int

    """
    Returns the last _n_ elements from the list.
    """
    last: Int

    """
    Ordering options for discussions returned from the connection.
    """
    orderBy: DiscussionOrder = {field: CREATED_AT, direction: DESC}

    """
    Filter discussions to only those in a specific repository.
    """
    repositoryId: ID
  ): DiscussionConnection!
}

RepositoryDiscussionCommentAuthor

์—ญ์‹œ User ๋ฐ Organization ํ˜•์‹์— ์˜ํ•ด ๊ตฌํ˜„๋ฉ๋‹ˆ๋‹ค.

ํ•„๋“œ
"""
Represents an author of discussion comments in repositories.
"""
interface RepositoryDiscussionCommentAuthor {
  """
  Discussion comments this user has authored.
  """
  repositoryDiscussionComments(
    """
    Returns the elements in the list that come after the specified cursor.
    """
    after: String

    """
    Returns the elements in the list that come before the specified cursor.
    """
    before: String

    """
    Returns the first _n_ elements from the list.
    """
    first: Int

    """
    Returns the last _n_ elements from the list.
    """
    last: Int

    """
    Filter discussion comments to only those that were marked as the answer
    """
    onlyAnswers: Boolean = false

    """
    Filter discussion comments to only those in a specific repository.
    """
    repositoryId: ID
  ): DiscussionCommentConnection!
}

๋ณ€ํ˜•

์ด๋Ÿฌํ•œ ๋ณ€ํ˜•์€ GraphQL API์˜ ๋‹ค๋ฅธ ๋ณ€ํ˜•๊ณผ ๋™์ผํ•œ ๊ตฌํ˜„ ํŒจํ„ด์„ ๋”ฐ๋ฆ…๋‹ˆ๋‹ค. ๊ฐ ๋ณ€ํ˜•์€ ๋ณ€ํ˜•์˜ ์ด๋ฆ„์„ ๋”ฐ์„œ ๋ช…๋ช…๋œ Input ํ˜•์‹์˜ ๋‹จ์ผ ์ธ์ˆ˜๋ฅผ ๋ฐ›์•„๋“ค์ด๊ณ , ์ง€์ •๋œ ํ•„๋“œ๊ฐ€ ํฌํ•จ๋œ Payload ํ˜•์‹์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ๋ฅผ ๋“ค์–ด, ๋‹ค์Œ์€ ์ƒˆ ํ† ๋ก ์„ ๋งŒ๋“œ๋Š” ๊ธฐ๋ณธ createDiscussion ๋ณ€ํ˜•์ž…๋‹ˆ๋‹ค.

mutation {
  # input type: CreateDiscussionInput
  createDiscussion(input: {repositoryId: "1234", categoryId: "5678", body: "The body", title: "The title"}) {

    # response type: CreateDiscussionPayload
    discussion {
      id
    }
  }
}

createDiscussion

์ž…๋ ฅ ํ•„๋“œ:

  • body: String! ์ƒˆ ํ† ๋ก ์˜ ๋ณธ๋ฌธ์ž…๋‹ˆ๋‹ค.
  • title: String! ์ƒˆ ํ† ๋ก ์˜ ์ œ๋ชฉ์ž…๋‹ˆ๋‹ค.
  • repositoryId: ID! ํ† ๋ก ์„ ๋งŒ๋“ค ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์˜ ID์ž…๋‹ˆ๋‹ค.
  • categoryId: ID! ์ด ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ๋‚ด์— ์žˆ๋Š” DiscussionCategory์˜ ID์ž…๋‹ˆ๋‹ค.
  • clientMutationId: String ๋ณ€ํ˜•์„ ์ˆ˜ํ–‰ํ•˜๋Š” ํด๋ผ์ด์–ธํŠธ์— ๋Œ€ํ•œ ๊ณ ์œ  ์‹๋ณ„์ž์ž…๋‹ˆ๋‹ค.

๋ฐ˜ํ™˜ ํ˜•์‹ ํ•„๋“œ:

  • clientMutationId: String ์ž…๋ ฅ์œผ๋กœ์„œ ์ œ๊ณต๋˜๋Š” ๊ณ ์œ  ์‹๋ณ„์ž์ž…๋‹ˆ๋‹ค.
  • discussion: Discussion ๋งŒ๋“ค์–ด์ง„ ํ† ๋ก ์ž…๋‹ˆ๋‹ค.

updateDiscussion

์ž…๋ ฅ ํ•„๋“œ:

  • discussionId: ID! ์—…๋ฐ์ดํŠธํ•  ํ† ๋ก ์˜ ๋…ธ๋“œ ID์ž…๋‹ˆ๋‹ค.
  • body: String ํ† ๋ก  ๋ณธ๋ฌธ์˜ ์ƒˆ ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค.
  • title: String ์ƒˆ ํ† ๋ก  ์ œ๋ชฉ์ž…๋‹ˆ๋‹ค.
  • categoryId: ID ์ด ํ† ๋ก ์„ ๋ณ€๊ฒฝํ•  ๋™์ผํ•œ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ๋‚ด์— ์žˆ๋Š” DiscussionCategory์˜ ๋…ธ๋“œ ID์ž…๋‹ˆ๋‹ค.
  • clientMutationId: String ๋ณ€ํ˜•์„ ์ˆ˜ํ–‰ํ•˜๋Š” ํด๋ผ์ด์–ธํŠธ์— ๋Œ€ํ•œ ๊ณ ์œ  ์‹๋ณ„์ž์ž…๋‹ˆ๋‹ค.

๋ฐ˜ํ™˜ ํ˜•์‹ ํ•„๋“œ:

  • clientMutationId: String ์ž…๋ ฅ์œผ๋กœ์„œ ์ œ๊ณต๋˜๋Š” ๊ณ ์œ  ์‹๋ณ„์ž์ž…๋‹ˆ๋‹ค.
  • discussion: Discussion ์ˆ˜์ •๋œ ํ† ๋ก ์ž…๋‹ˆ๋‹ค.

deleteDiscussion

์ž…๋ ฅ ํ•„๋“œ:

  • id: ID! ์‚ญ์ œํ•  ํ† ๋ก ์˜ ๋…ธ๋“œ ID์ž…๋‹ˆ๋‹ค.
  • clientMutationId: String ๋ณ€ํ˜•์„ ์ˆ˜ํ–‰ํ•˜๋Š” ํด๋ผ์ด์–ธํŠธ์— ๋Œ€ํ•œ ๊ณ ์œ  ์‹๋ณ„์ž์ž…๋‹ˆ๋‹ค.

๋ฐ˜ํ™˜ ํ˜•์‹ ํ•„๋“œ:

  • clientMutationId: String ์ž…๋ ฅ์œผ๋กœ์„œ ์ œ๊ณต๋˜๋Š” ๊ณ ์œ  ์‹๋ณ„์ž์ž…๋‹ˆ๋‹ค.
  • discussion: Discussion ์‚ญ์ œ๋œ ํ† ๋ก ์ž…๋‹ˆ๋‹ค.

addDiscussionComment

์ž…๋ ฅ ํ•„๋“œ:

  • body: String! ์ฃผ์„์˜ ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค.
  • discussionId: ID! ์ฃผ์„์„ ๋‹ฌ ํ† ๋ก ์˜ ๋…ธ๋“œ ID์ž…๋‹ˆ๋‹ค.
  • replyToId: ID ํšŒ์‹ ํ•  ํ† ๋ก  ์ฃผ์„์˜ ๋…ธ๋“œ ID์ž…๋‹ˆ๋‹ค. ์—†๋Š” ๊ฒฝ์šฐ, ๋งŒ๋“ค์–ด์ง„ ์ฃผ์„์€ ์ตœ์ƒ์œ„ ์ฃผ์„์ด ๋ฉ๋‹ˆ๋‹ค.
  • clientMutationId: String ๋ณ€ํ˜•์„ ์ˆ˜ํ–‰ํ•˜๋Š” ํด๋ผ์ด์–ธํŠธ์— ๋Œ€ํ•œ ๊ณ ์œ  ์‹๋ณ„์ž์ž…๋‹ˆ๋‹ค.

๋ฐ˜ํ™˜ ํ˜•์‹ ํ•„๋“œ:

  • clientMutationId: String ์ž…๋ ฅ์œผ๋กœ์„œ ์ œ๊ณต๋˜๋Š” ๊ณ ์œ  ์‹๋ณ„์ž์ž…๋‹ˆ๋‹ค.
  • comment: DiscussionComment ๋งŒ๋“ค์–ด์ง„ ํ† ๋ก  ์ฃผ์„์ž…๋‹ˆ๋‹ค.

updateDiscussionComment

์ž…๋ ฅ ํ•„๋“œ:

  • body: String! ์ฃผ์„ ๋ณธ๋ฌธ์˜ ์ƒˆ ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค.
  • commentId: ID! ์—…๋ฐ์ดํŠธํ•  ํ† ๋ก  ์ฃผ์„์˜ ๋…ธ๋“œ ID์ž…๋‹ˆ๋‹ค.
  • clientMutationId: String ๋ณ€ํ˜•์„ ์ˆ˜ํ–‰ํ•˜๋Š” ํด๋ผ์ด์–ธํŠธ์— ๋Œ€ํ•œ ๊ณ ์œ  ์‹๋ณ„์ž์ž…๋‹ˆ๋‹ค.

๋ฐ˜ํ™˜ ํ˜•์‹ ํ•„๋“œ:

  • clientMutationId: String ์ž…๋ ฅ์œผ๋กœ์„œ ์ œ๊ณต๋˜๋Š” ๊ณ ์œ  ์‹๋ณ„์ž์ž…๋‹ˆ๋‹ค.
  • comment: DiscussionComment ์—…๋ฐ์ดํŠธ๋œ ํ† ๋ก  ์ฃผ์„์ž…๋‹ˆ๋‹ค.

deleteDiscussionComment

์ž…๋ ฅ ํ•„๋“œ:

  • id: ID! ์‚ญ์ œํ•  ํ† ๋ก  ์ฃผ์„์˜ ๋…ธ๋“œ ID์ž…๋‹ˆ๋‹ค.
  • clientMutationId: String ๋ณ€ํ˜•์„ ์ˆ˜ํ–‰ํ•˜๋Š” ํด๋ผ์ด์–ธํŠธ์— ๋Œ€ํ•œ ๊ณ ์œ  ์‹๋ณ„์ž์ž…๋‹ˆ๋‹ค.

๋ฐ˜ํ™˜ ํ˜•์‹ ํ•„๋“œ:

  • clientMutationId: String ์ž…๋ ฅ์œผ๋กœ์„œ ์ œ๊ณต๋˜๋Š” ๊ณ ์œ  ์‹๋ณ„์ž์ž…๋‹ˆ๋‹ค.
  • comment: DiscussionComment ์‚ญ์ œ๋œ ํ† ๋ก  ์ฃผ์„์ž…๋‹ˆ๋‹ค.

markDiscussionCommentAsAnswer

์ž…๋ ฅ ํ•„๋“œ:

  • id: ID! ๋‹ต๋ณ€์œผ๋กœ ํ‘œ์‹œํ•  ํ† ๋ก  ์ฃผ์„์˜ ๋…ธ๋“œ ID์ž…๋‹ˆ๋‹ค.
  • clientMutationId: String ๋ณ€ํ˜•์„ ์ˆ˜ํ–‰ํ•˜๋Š” ํด๋ผ์ด์–ธํŠธ์— ๋Œ€ํ•œ ๊ณ ์œ  ์‹๋ณ„์ž์ž…๋‹ˆ๋‹ค.

๋ฐ˜ํ™˜ ํ˜•์‹ ํ•„๋“œ:

  • clientMutationId: String ์ž…๋ ฅ์œผ๋กœ์„œ ์ œ๊ณต๋˜๋Š” ๊ณ ์œ  ์‹๋ณ„์ž์ž…๋‹ˆ๋‹ค.
  • discussion: Discussion ์„ ํƒํ•œ ์ฃผ์„์ด ํฌํ•จ๋œ ํ† ๋ก ์ž…๋‹ˆ๋‹ค.

unmarkDiscussionCommentAsAnswer

์ž…๋ ฅ ํ•„๋“œ:

  • id: ID! ๋‹ต๋ณ€์œผ๋กœ ํ‘œ์‹œ๋ฅผ ํ•ด์ œํ•  ํ† ๋ก  ์ฃผ์„์˜ ๋…ธ๋“œ ID์ž…๋‹ˆ๋‹ค.
  • clientMutationId: String ๋ณ€ํ˜•์„ ์ˆ˜ํ–‰ํ•˜๋Š” ํด๋ผ์ด์–ธํŠธ์— ๋Œ€ํ•œ ๊ณ ์œ  ์‹๋ณ„์ž์ž…๋‹ˆ๋‹ค.

๋ฐ˜ํ™˜ ํ˜•์‹ ํ•„๋“œ:

  • clientMutationId: String ์ž…๋ ฅ์œผ๋กœ์„œ ์ œ๊ณต๋˜๋Š” ๊ณ ์œ  ์‹๋ณ„์ž์ž…๋‹ˆ๋‹ค.
  • discussion: Discussion ํ‘œ์‹œ๋˜์ง€ ์•Š์€ ์ฃผ์„์ด ํฌํ•จ๋œ ํ† ๋ก ์ž…๋‹ˆ๋‹ค.

ํ† ๋ก ์€ ์ตœ์ƒ์œ„ search ํ•„๋“œ์—์„œ ๋ฐ˜ํ™˜๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ† ๋ก ์„ ๊ฒ€์ƒ‰ํ•˜๋ ค๋ฉด type์„ DISCUSSION์œผ๋กœ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. SearchResultItemConnection ํ˜•์‹์—๋Š” ๋ฐ˜ํ™˜๋œ ํ† ๋ก  ์ˆ˜๋ฅผ ๋ณด๊ณ ํ•˜๋Š” discussionCount ํ•„๋“œ๊ฐ€ ์žˆ์œผ๋ฉฐ Discussion ํ˜•์‹์€ SearchResultItem ๊ณต์šฉ ๊ตฌ์กฐ์ฒด์— ์ถ”๊ฐ€๋ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์ฟผ๋ฆฌ ๋ฐ ํ† ๋ก  ๊ฒ€์ƒ‰์„(๋ฅผ) ์ฐธ์กฐํ•˜์„ธ์š”.