FenX - Comments GraphQL API Reference

Welcome to the Comments GraphQL API Reference page! This page serves as a comprehensive guide to understanding and utilizing the capabilities of FenX Comments GraphQL API. On this reference page, you will find detailed documentation for all the types, fields, queries, mutations, and subscriptions available in our GraphQL API. We have provided clear and concise descriptions for each component, including their purpose, input arguments, and return types.

API Endpoints
# Main:
https://comments.fenergox.com/graphql
# Regional:
https://comments.{Region}.fenergox.com/graphql
Headers
Authorization: Bearer <ACCESS_TOKEN>

Getting Started

GraphQL is a powerful query language and runtime that enables efficient and flexible communication between clients and servers. With GraphQL, you can precisely request the data you need, reducing over-fetching and under-fetching of data, and allowing for rapid development and iteration.

On this reference page, you will find detailed documentation for all the types, fields, queries, mutations, and subscriptions available in our GraphQL API. We have provided clear and concise descriptions for each component, including their purpose, input arguments, and return types.

To get started, familiarize yourself with the main components of our API schema. The "Query" type represents the entry point for retrieving data, the "Mutation" type handles data modifications, and the "Subscription" type enables real-time event notifications.

Whether you are a developer integrating with our API or an API consumer exploring the available functionality, this reference page will serve as your comprehensive resource. Use the provided documentation to understand how to formulate queries, mutations, and subscriptions to interact with our GraphQL API effectively.

We hope this GraphQL API Reference page empowers you to leverage the full potential of our API and build exceptional applications with ease. Happy exploring!

Queries

getCommentThread

Description

Retrieves a specific comment thread within a channel.

Response

Returns a CommentThread

Arguments
Name Description
channelId - ID! The identifier of the channel.
commentId - ID! The identifier of the comment.

Example

Query
query GetCommentThread(
  $channelId: ID!,
  $commentId: ID!
) {
  getCommentThread(
    channelId: $channelId,
    commentId: $commentId
  ) {
    id
    channelId
    content
    createdAt
    deleted
    author {
      id
      type
    }
    numberOfReplies
    replies {
      pageInfo {
        hasNextPage
        startCursor
        endCursor
      }
      edges {
        cursor
        node {
          id
          channelId
          content
          createdAt
          deleted
          author {
            id
            type
          }
        }
      }
    }
  }
}
Variables
{
  "channelId": "8c8c0196-0b6a-5ccf-9b1d-86afb1909b97",
  "commentId": "0dfbfd4f-b2cb-5452-8d2f-eb8d9a595825"
}
Response
{
  "data": {
    "getCommentThread": {
      "id": "0dfbfd4f-b2cb-5452-8d2f-eb8d9a595825",
      "channelId": "8c8c0196-0b6a-5ccf-9b1d-86afb1909b97",
      "content": "Comment content.",
      "createdAt": "2023-10-07T01:08:03.420Z",
      "deleted": false,
      "author": Author,
      "numberOfReplies": 123,
      "replies": CommentThreadRepliesConnection
    }
  }
}

getOrCreateChannel

Description

Retrieves an existing channel or creates a new one for the given entity.

Response

Returns a Channel

Arguments
Name Description
entityType - String! The type of the entity.
entityId - String! The identifier of the entity.

Example

Query
query GetOrCreateChannel(
  $entityType: String!,
  $entityId: String!
) {
  getOrCreateChannel(
    entityType: $entityType,
    entityId: $entityId
  ) {
    id
    tenant
    comments {
      pageInfo {
        hasNextPage
        startCursor
        endCursor
      }
      edges {
        cursor
        node {
          id
          channelId
          content
          createdAt
          deleted
          author {
            id
            type
          }
          numberOfReplies
          replies {
            pageInfo {
              hasNextPage
              startCursor
              endCursor
            }
            edges {
              cursor
              node {
                id
                channelId
                content
                createdAt
                deleted
                author {
                  id
                  type
                }
              }
            }
          }
        }
      }
    }
  }
}
Variables
{
  "entityType": ["Journey", "Entity"],
  "entityId": "c5728138-f8e5-5e43-9439-961a9b7bc415"
}
Response
{
  "data": {
    "getOrCreateChannel": {
      "id": "8c8c0196-0b6a-5ccf-9b1d-86afb1909b97",
      "tenant": "5ba94486-6625-44a5-9e18-569f542ad8b8",
      "comments": ChannelCommentThreadsConnection
    }
  }
}

node

Description

Retrieves an object by its unique identifier.

Response

Returns a Node

Arguments
Name Description
id - ID! The unique identifier of the object.

Example

Query
query Node($id: ID!) {
  node(id: $id) {
    id
  }
}
Variables
{
  "id": "5ba94486-6625-44a5-9e18-569f542ad8b8"
}
Response
{
  "data": {
    "node": {
      "id": "5ba94486-6625-44a5-9e18-569f542ad8b8"
    }
  }
}

Mutations

deleteComment

Description

Mutation to delete a comment on a channel.

Response

Returns a CommentBase

Arguments
Name Description
channelId - ID! The identifier of the channel where the comment is located.
commentId - ID! The identifier of the comment to delete.

Example

Query
mutation DeleteComment(
  $channelId: ID!,
  $commentId: ID!
) {
  deleteComment(
    channelId: $channelId,
    commentId: $commentId
  ) {
    id
    channelId
    content
    createdAt
    deleted
    author {
      id
      type
    }
  }
}
Variables
{
  "channelId": "5ba94486-6625-44a5-9e18-569f542ad8b8",
  "commentId": "5ba94486-6625-44a5-9e18-569f542ad8b8"
}
Response
{
  "data": {
    "deleteComment": {
      "id": "0dfbfd4f-b2cb-5452-8d2f-eb8d9a595825",
      "channelId": "8c8c0196-0b6a-5ccf-9b1d-86afb1909b97",
      "content": "Comment content.",
      "createdAt": "2023-10-07T01:08:03.420Z",
      "deleted": false,
      "author": Author
    }
  }
}

postComment

Description

Mutation to post a comment on a channel.

Arguments
Name Description
channelId - ID! The identifier of the channel where the comment is posted.
content - String! The content of the comment.

Example

Query
mutation PostComment(
  $channelId: ID!,
  $content: String!
) {
  postComment(
    channelId: $channelId,
    content: $content
  ) {
    channelId
    commentEdge {
      cursor
      node {
        id
        channelId
        content
        createdAt
        deleted
        author {
          id
          type
        }
        numberOfReplies
        replies {
          pageInfo {
            hasNextPage
            startCursor
            endCursor
          }
          edges {
            cursor
            node {
              id
              channelId
              content
              createdAt
              deleted
              author {
                id
                type
              }
            }
          }
        }
      }
    }
  }
}
Variables
{
  "channelId": "5ba94486-6625-44a5-9e18-569f542ad8b8",
  "content": "Comment content."
}
Response
{
  "data": {
    "postComment": {
      "channelId": "8c8c0196-0b6a-5ccf-9b1d-86afb1909b97",
      "commentEdge": ChannelCommentThreadsEdge
    }
  }
}

replyToComment

Description

Mutation to reply to a comment on a channel.

Response

Returns a ReplyToCommentMutationResponse

Arguments
Name Description
channelId - ID! The identifier of the channel where the comment is located.
commentId - ID! The identifier of the comment to reply to.
content - String! The content of the reply.

Example

Query
mutation ReplyToComment(
  $channelId: ID!,
  $commentId: ID!,
  $content: String!
) {
  replyToComment(
    channelId: $channelId,
    commentId: $commentId,
    content: $content
  ) {
    commentId
    channelId
    commentThread {
      id
      channelId
      content
      createdAt
      deleted
      author {
        id
        type
      }
      numberOfReplies
      replies {
        pageInfo {
          hasNextPage
          startCursor
          endCursor
        }
        edges {
          cursor
          node {
            id
            channelId
            content
            createdAt
            deleted
            author {
              id
              type
            }
          }
        }
      }
    }
    replyEdge {
      cursor
      node {
        id
        channelId
        content
        createdAt
        deleted
        author {
          id
          type
        }
      }
    }
  }
}
Variables
{
  "channelId": "8c8c0196-0b6a-5ccf-9b1d-86afb1909b97",
  "commentId": "0dfbfd4f-b2cb-5452-8d2f-eb8d9a595825",
  "content": "Comment content."
}
Response
{
  "data": {
    "replyToComment": {
      "commentId": "0dfbfd4f-b2cb-5452-8d2f-eb8d9a595825",
      "channelId": "8c8c0196-0b6a-5ccf-9b1d-86afb1909b97",
      "commentThread": CommentThread,
      "replyEdge": CommentThreadRepliesEdge
    }
  }
}

Types

Author

Description

The Author object represents a user who created the comment.

Fields
Field Name Description
id - ID The unique identifier for the author.
type - AuthorType! The type of the author.
Example
{
  "id": "5ba94486-6625-44a5-9e18-569f542ad8b8",
  "type": "USER"
}

AuthorType

Description

Enumeration representing the type of an author.

Values
Enum Value Description

USER

The author is a regular user.

INTEGRATION_CLIENT

The author is an integration client.
Example
"USER"

Boolean

Description

The Boolean scalar type represents true or false.

Example
true

Channel

Description

The Channel object.

Fields
Field Name Description
id - ID! The unique identifier for the channel.
tenant - ID! The identifier of the tenant associated with the channel.
comments - ChannelCommentThreadsConnection Retrieves a connection of comment threads associated with the channel.
Arguments
first - Int!

The maximum number of comment threads to retrieve.

after - String

A cursor for pagination, specifying the starting point to fetch comment threads.

Example
{
  "id": "8c8c0196-0b6a-5ccf-9b1d-86afb1909b97",
  "tenant": "5ba94486-6625-44a5-9e18-569f542ad8b8",
  "comments": ChannelCommentThreadsConnection
}

ChannelCommentThreadsConnection

Description

Represents a connection of comment threads for a channel.

Fields
Field Name Description
pageInfo - PageInfo! Information about the pagination of this connection.
edges - [ChannelCommentThreadsEdge!]! The list of edges representing the comment threads.
Example
{
  "pageInfo": PageInfo,
  "edges": [ChannelCommentThreadsEdge]
}

ChannelCommentThreadsEdge

Description

Represents an edge in a connection of channel comment threads.

Fields
Field Name Description
cursor - String! The cursor for this edge.
node - CommentThread The comment thread associated with this edge.
Example
{
  "cursor": "abc123",
  "node": CommentThread
}

ChannelPostCommentMutationResponse

Description

The response type for the mutation to post a comment on a channel post.

Fields
Field Name Description
channelId - ID! The identifier of the channel associated with the comment.
commentEdge - ChannelCommentThreadsEdge The edge representing the newly posted comment.
Example
{
  "channelId": "8c8c0196-0b6a-5ccf-9b1d-86afb1909b97",
  "commentEdge": ChannelCommentThreadsEdge
}

Comment

Description

The Comment type represents a comment object that implements both the CommentBase interface and the Node interface.

Fields
Field Name Description
id - ID! The unique identifier for the comment.
channelId - ID! The identifier of the channel associated with the comment.
content - String! The content of the comment.
createdAt - String! The timestamp indicating when the comment was created.
deleted - Boolean! Indicates whether the comment has been deleted.
author - Author
Example
{
  "id": "0dfbfd4f-b2cb-5452-8d2f-eb8d9a595825",
  "channelId": "8c8c0196-0b6a-5ccf-9b1d-86afb1909b97",
  "content": "Comment content.",
  "createdAt": "2023-10-07T01:08:03.420Z",
  "deleted": false,
  "author": Author
}

CommentBase

Description

The CommentBase interface represents the base fields for a comment.It implements the Node interface, providing the required fields for identification.

Fields
Field Name Description
id - ID! The unique identifier for the comment.
channelId - ID! The identifier of the channel associated with the comment.
content - String! The content of the comment.
createdAt - String! The timestamp indicating when the comment was created.
deleted - Boolean! Indicates whether the comment has been deleted.
author - Author
Possible Types
CommentBase Types

Comment

CommentThread

Example
{
  "id": "0dfbfd4f-b2cb-5452-8d2f-eb8d9a595825",
  "channelId": "8c8c0196-0b6a-5ccf-9b1d-86afb1909b97",
  "content": "Comment content.",
  "createdAt": "2023-10-07T01:08:03.420Z",
  "deleted": false,
  "author": Author
}

CommentThread

Description

The CommentThread type represents a comment thread object that implements both the CommentBase interface and the Node interface.

Fields
Field Name Description
id - ID! The unique identifier for the comment thread.
channelId - ID! The identifier of the channel associated with the comment thread.
content - String! The content of the comment thread.
createdAt - String! The timestamp indicating when the comment thread was created.
deleted - Boolean! Indicates whether the comment thread has been deleted.
author - Author
numberOfReplies - Int! The number of replies in the comment thread.
replies - CommentThreadRepliesConnection Retrieves a connection of replies for the comment thread.
Arguments
first - Int!

The maximum number of replies to retrieve.

after - String

A cursor for pagination, specifying the starting point to fetch replies.

Example
{
  "id": "0dfbfd4f-b2cb-5452-8d2f-eb8d9a595825",
  "channelId": "8c8c0196-0b6a-5ccf-9b1d-86afb1909b97",
  "content": "Comment content.",
  "createdAt": "2023-10-07T01:08:03.420Z",
  "deleted": false,
  "author": Author,
  "numberOfReplies": 123,
  "replies": CommentThreadRepliesConnection
}

CommentThreadRepliesConnection

Description

Represents a connection of replies for a comment thread.

Fields
Field Name Description
pageInfo - PageInfo! Information about the pagination of this connection.
edges - [CommentThreadRepliesEdge!]! The list of edges representing the replies.
Example
{
  "pageInfo": PageInfo,
  "edges": [CommentThreadRepliesEdge]
}

CommentThreadRepliesEdge

Description

Represents an edge in a connection of replies for a comment thread.

Fields
Field Name Description
cursor - String! The cursor for this edge.
node - Comment The reply associated with this edge.
Example
{
  "cursor": "xyz789",
  "node": Comment
}

ID

Description

The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

Example
"5ba94486-6625-44a5-9e18-569f542ad8b8"

Int

Description

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example
123

Node

Description

The Node interface represents an object that can be uniquely identified. It defines a contract that concrete types must adhere to by implementing the required fields.

Fields
Field Name Description
id - ID! The unique identifier for the object.
Possible Types
Node Types

Channel

Comment

CommentThread

Example
{
  "id": "5ba94486-6625-44a5-9e18-569f542ad8b8"
}

PageInfo

Description

Information about the pagination of a connection.

Fields
Field Name Description
hasNextPage - Boolean! Indicates whether there is a next page available.
startCursor - String The cursor representing the start of the page.
endCursor - String The cursor representing the end of the page.
Example
{
  "hasNextPage": true,
  "startCursor": "eHl6Nzg5Cg==",
  "endCursor": "YWJjMTIzCg=="
}

ReplyToCommentMutationResponse

Description

The response type for the mutation to reply to a comment.

Fields
Field Name Description
commentId - ID The identifier of the replied comment.
channelId - ID! The identifier of the channel associated with the replied comment.
commentThread - CommentThread The comment thread containing the replied comment.
replyEdge - CommentThreadRepliesEdge The edge representing the newly posted reply.
Example
{
  "commentId": "0dfbfd4f-b2cb-5452-8d2f-eb8d9a595825",
  "channelId": "8c8c0196-0b6a-5ccf-9b1d-86afb1909b97",
  "commentThread": CommentThread,
  "replyEdge": CommentThreadRepliesEdge
}

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"abc123"