MyBoom GraphQL API Reference
本網站為 MyBoom 交友平台後端服務的 GraphQL API 規格文檔,包含 App 端及網站管理後台端需要的 API 接口。
若你看不懂本文檔或是不知道如何使用,請參考以下連結:
- GraphQL 官方教學 https://graphql.org/learn/
- Apollo 官方教學 https://www.apollographql.com/docs/react/
Contact
若串接過程中遇到任何問題,請加 Line 聯繫 - varedx20001207
API Endpoints
https://api.myboom.tw/graphql Headers
Authorization: Bearer <YOUR_TOKEN_HERE> Queries
admins
Description
管理員列表
Response
Returns an
AdminConnection!
Example
Query
query admins(
$skip: Int,
$limit: Int,
$keyword: String
) {
admins(
skip: $skip,
limit: $limit,
keyword: $keyword
) {
edges {
...AdminEdgeFragment
}
pageInfo {
...PageInfoFragment
}
}
}
Variables
{
"skip": 0,
"limit": 10,
"keyword": "abc123"
}
Response
{
"data": {
"admins": {
"edges": [AdminEdge],
"pageInfo": PageInfo
}
}
}
categories
Response
Returns a
CategoryConnection!
Example
Query
query categories(
$skip: Int,
$limit: Int
) {
categories(
skip: $skip,
limit: $limit
) {
edges {
...CategoryEdgeFragment
}
pageInfo {
...PageInfoFragment
}
}
}
Variables
{"skip": 0, "limit": 10}
Response
{
"data": {
"categories": {
"edges": [CategoryEdge],
"pageInfo": PageInfo
}
}
}
comments
Response
Returns a
CommentConnection!
Example
Query
query comments(
$skip: Int,
$limit: Int,
$topicId: String,
$authorId: String
) {
comments(
skip: $skip,
limit: $limit,
topicId: $topicId,
authorId: $authorId
) {
edges {
...CommentEdgeFragment
}
pageInfo {
...PageInfoFragment
}
}
}
Variables
{
"skip": 0,
"limit": 10,
"topicId": "xyz789",
"authorId": "xyz789"
}
Response
{
"data": {
"comments": {
"edges": [CommentEdge],
"pageInfo": PageInfo
}
}
}
hotKeywords
Description
熱門搜尋關鍵字
Response
Returns
[String!]!
Example
Query
query hotKeywords(
$skip: Int,
$limit: Int
) {
hotKeywords(
skip: $skip,
limit: $limit
)
}
Variables
{"skip": 0, "limit": 10}
Response
{"data": {"hotKeywords": ["abc123"]}}
notificationTasks
Description
管理員從後台手動發出(或還未發出)的推播通知
Response
Returns a
NotificationTaskConnection!
Example
Query
query notificationTasks(
$skip: Int,
$limit: Int,
$isSent: Boolean
) {
notificationTasks(
skip: $skip,
limit: $limit,
isSent: $isSent
) {
edges {
...NotificationTaskEdgeFragment
}
pageInfo {
...PageInfoFragment
}
}
}
Variables
{"skip": 0, "limit": 10, "isSent": false}
Response
{
"data": {
"notificationTasks": {
"edges": [NotificationTaskEdge],
"pageInfo": PageInfo
}
}
}
notifications
Response
Returns a
NotificationConnection!
Example
Query
query notifications(
$receiverId: String!,
$skip: Int,
$limit: Int
) {
notifications(
receiverId: $receiverId,
skip: $skip,
limit: $limit
) {
edges {
...NotificationEdgeFragment
}
pageInfo {
...PageInfoFragment
}
}
}
Variables
{
"receiverId": "abc123",
"skip": 0,
"limit": 10
}
Response
{
"data": {
"notifications": {
"edges": [NotificationEdge],
"pageInfo": PageInfo
}
}
}
topic
Example
Query
query topic($id: String!) {
topic(id: $id) {
id
title
author {
...UserFragment
}
category {
...CategoryFragment
}
options {
...OptionFragment
}
isVoted
voteCount
isSaved
createdAt
comments {
...CommentConnectionFragment
}
isWatching
}
}
Variables
{"id": "abc123"}
Response
{
"data": {
"topic": {
"id": "507f1f77bcf86cd799439011",
"title": "abc123",
"author": User,
"category": Category,
"options": [Option],
"isVoted": true,
"voteCount": 27,
"isSaved": true,
"createdAt": "2020-01-01T00:00:00.000Z",
"comments": CommentConnection,
"isWatching": false
}
}
}
topics
Response
Returns a
TopicConnection!
Example
Query
query topics(
$skip: Int,
$limit: Int,
$authorId: String,
$isVoted: Boolean,
$isSaved: Boolean,
$keyword: String,
$categoryId: String
) {
topics(
skip: $skip,
limit: $limit,
authorId: $authorId,
isVoted: $isVoted,
isSaved: $isSaved,
keyword: $keyword,
categoryId: $categoryId
) {
edges {
...TopicEdgeFragment
}
pageInfo {
...PageInfoFragment
}
}
}
Variables
{
"skip": 0,
"limit": 10,
"authorId": "abc123",
"isVoted": true,
"isSaved": true,
"keyword": "xyz789",
"categoryId": "abc123"
}
Response
{
"data": {
"topics": {
"edges": [TopicEdge],
"pageInfo": PageInfo
}
}
}
user
Example
Query
query user($id: String!) {
user(id: $id) {
id
name
avatarUrl
email
registeredAt
topicCount
commentedCount
commentCount
savedCount
votedCount
followerCount
followingCount
appleIdentifier
googleIdentifier
facebookIdentifier
lineIdentifier
isFollowing
watchingTopicIDs
notificationSettings {
...UserNotificationSettingsFragment
}
}
}
Variables
{"id": "abc123"}
Response
{
"data": {
"user": {
"id": "507f1f77bcf86cd799439011",
"name": "xyz789",
"avatarUrl": "https://example.com/exmaple",
"email": "abc123",
"registeredAt": "2020-01-01T00:00:00.000Z",
"topicCount": 27,
"commentedCount": 27,
"commentCount": 27,
"savedCount": 27,
"votedCount": 27,
"followerCount": 27,
"followingCount": 27,
"appleIdentifier": "abc123",
"googleIdentifier": "abc123",
"facebookIdentifier": "abc123",
"lineIdentifier": "abc123",
"isFollowing": false,
"watchingTopicIDs": [
"507f1f77bcf86cd799439011"
],
"notificationSettings": UserNotificationSettings
}
}
}
users
Response
Returns a
UserConnection!
Example
Query
query users(
$skip: Int,
$limit: Int,
$followedBy: String,
$keyword: String
) {
users(
skip: $skip,
limit: $limit,
followedBy: $followedBy,
keyword: $keyword
) {
edges {
...UserEdgeFragment
}
pageInfo {
...PageInfoFragment
}
}
}
Variables
{
"skip": 0,
"limit": 10,
"followedBy": "xyz789",
"keyword": "abc123"
}
Response
{
"data": {
"users": {
"edges": [UserEdge],
"pageInfo": PageInfo
}
}
}
Mutations
adminSignIn
Description
管理員登入
Response
Returns an
AdminLoginResponse!
Example
Query
mutation adminSignIn(
$username: String!,
$password: String!
) {
adminSignIn(
username: $username,
password: $password
) {
token
admin {
...AdminFragment
}
}
}
Variables
{
"username": "xyz789",
"password": "abc123"
}
Response
{
"data": {
"adminSignIn": {
"token": "xyz789",
"admin": Admin
}
}
}
cancelNotificationTask
Description
管理員取消已排程的推播通知
Response
Returns a
NotificationTask!
Arguments
| Name | Description |
|---|---|
taskID -
ID!
|
Example
Query
mutation cancelNotificationTask($taskID: ID!) {
cancelNotificationTask(taskID: $taskID) {
id
title
content
createdAt
createdBy
time
cancelAt
}
}
Variables
{"taskID": "507f1f77bcf86cd799439011"}
Response
{
"data": {
"cancelNotificationTask": {
"id": "507f1f77bcf86cd799439011",
"title": "xyz789",
"content": "abc123",
"createdAt": "2020-01-01T00:00:00.000Z",
"createdBy": "507f1f77bcf86cd799439011",
"time": "abc123",
"cancelAt": "2020-01-01T00:00:00.000Z"
}
}
}
cancelSaveTopic
Description
取消收藏話題
createAdmin
Description
新增管理員帳號
Response
Returns an
Admin
Arguments
| Name | Description |
|---|---|
username -
String!
|
|
password -
String!
|
|
nickname -
String!
|
|
permissions -
[AdminPermission!]!
|
Example
Query
mutation createAdmin(
$username: String!,
$password: String!,
$nickname: String!,
$permissions: [AdminPermission!]!
) {
createAdmin(
username: $username,
password: $password,
nickname: $nickname,
permissions: $permissions
) {
id
username
nickname
createdAt
permissions
}
}
Variables
{
"username": "abc123",
"password": "xyz789",
"nickname": "xyz789",
"permissions": ["USER_MANAGEMENT"]
}
Response
{
"data": {
"createAdmin": {
"id": "507f1f77bcf86cd799439011",
"username": "abc123",
"nickname": "abc123",
"createdAt": "2020-01-01T00:00:00.000Z",
"permissions": ["USER_MANAGEMENT"]
}
}
}
createCategory
Description
(管理後台)建立話題分類
Example
Query
mutation createCategory(
$name: String!,
$image: Upload!
) {
createCategory(
name: $name,
image: $image
) {
id
name
imageUrl
topicCount
starCount
}
}
Variables
{
"name": "abc123",
"image": "File"
}
Response
{
"data": {
"createCategory": {
"id": "507f1f77bcf86cd799439011",
"name": "abc123",
"imageUrl": "https://example.com/exmaple",
"topicCount": 27,
"starCount": 27
}
}
}
createComment
Description
發表留言
Example
Query
mutation createComment(
$topicId: String!,
$content: String!
) {
createComment(
topicId: $topicId,
content: $content
) {
id
topic {
...TopicFragment
}
createdAt
content
author {
...UserFragment
}
}
}
Variables
{
"topicId": "xyz789",
"content": "abc123"
}
Response
{
"data": {
"createComment": {
"id": "507f1f77bcf86cd799439011",
"topic": Topic,
"createdAt": "2020-01-01T00:00:00.000Z",
"content": "xyz789",
"author": User
}
}
}
createTopic
Description
建立話題
Response
Returns a
Topic!
Arguments
| Name | Description |
|---|---|
title -
String!
|
|
categoryId -
String!
|
|
options -
[OptionInput!]!
|
Example
Query
mutation createTopic(
$title: String!,
$categoryId: String!,
$options: [OptionInput!]!
) {
createTopic(
title: $title,
categoryId: $categoryId,
options: $options
) {
id
title
author {
...UserFragment
}
category {
...CategoryFragment
}
options {
...OptionFragment
}
isVoted
voteCount
isSaved
createdAt
comments {
...CommentConnectionFragment
}
isWatching
}
}
Variables
{
"title": "abc123",
"categoryId": "abc123",
"options": [OptionInput]
}
Response
{
"data": {
"createTopic": {
"id": "507f1f77bcf86cd799439011",
"title": "abc123",
"author": User,
"category": Category,
"options": [Option],
"isVoted": true,
"voteCount": 27,
"isSaved": false,
"createdAt": "2020-01-01T00:00:00.000Z",
"comments": CommentConnection,
"isWatching": false
}
}
}
deleteCategory
Description
(管理後台)刪除話題分類
deleteComment
Description
刪除留言
deleteTopic
Description
刪除話題
followUser
Description
追蹤使用者
generateCaptcha
Description
取得 Captcha 驗證碼
Response
Returns a
String!
Example
Query
mutation generateCaptcha {
generateCaptcha
}
Response
{"data": {"generateCaptcha": "xyz789"}}
oauthSignIn
Description
OAuth 註冊或登入
Response
Returns a
LoginResponse!
Arguments
| Name | Description |
|---|---|
provider -
OAuthProvider!
|
|
code -
String!
|
Example
Query
mutation oauthSignIn(
$provider: OAuthProvider!,
$code: String!
) {
oauthSignIn(
provider: $provider,
code: $code
) {
token
user {
...UserFragment
}
}
}
Variables
{"provider": "GOOGLE", "code": "abc123"}
Response
{
"data": {
"oauthSignIn": {
"token": "abc123",
"user": User
}
}
}
readNotification
Description
已讀通知
readNotifications
Description
已讀多筆通知
Response
Returns a
Boolean!
Arguments
| Name | Description |
|---|---|
notificationsID -
[String!]!
|
Example
Query
mutation readNotifications($notificationsID: [String!]!) {
readNotifications(notificationsID: $notificationsID)
}
Variables
{"notificationsID": ["xyz789"]}
Response
{"data": {"readNotifications": true}}
registerDevice
Description
註冊設備推播通知
Example
Query
mutation registerDevice(
$expoToken: String!,
$deviceModel: String!
) {
registerDevice(
expoToken: $expoToken,
deviceModel: $deviceModel
)
}
Variables
{
"expoToken": "xyz789",
"deviceModel": "abc123"
}
Response
{"data": {"registerDevice": true}}
saveTopic
Description
收藏話題
sendNotification
Description
管理員手動發送推播通知
Response
Returns a
NotificationTask!
Example
Query
mutation sendNotification(
$title: String!,
$content: String!,
$sendTime: String!
) {
sendNotification(
title: $title,
content: $content,
sendTime: $sendTime
) {
id
title
content
createdAt
createdBy
time
cancelAt
}
}
Variables
{
"title": "xyz789",
"content": "xyz789",
"sendTime": "abc123"
}
Response
{
"data": {
"sendNotification": {
"id": "507f1f77bcf86cd799439011",
"title": "abc123",
"content": "xyz789",
"createdAt": "2020-01-01T00:00:00.000Z",
"createdBy": "507f1f77bcf86cd799439011",
"time": "abc123",
"cancelAt": "2020-01-01T00:00:00.000Z"
}
}
}
traditionalSignIn
Description
使用 Email 和密碼登入
Response
Returns a
LoginResponse!
Example
Query
mutation traditionalSignIn(
$email: String!,
$password: String!
) {
traditionalSignIn(
email: $email,
password: $password
) {
token
user {
...UserFragment
}
}
}
Variables
{
"email": "abc123",
"password": "xyz789"
}
Response
{
"data": {
"traditionalSignIn": {
"token": "xyz789",
"user": User
}
}
}
traditionalSignUp
Description
使用 Email 和密碼註冊帳號
Response
Returns a
LoginResponse!
Example
Query
mutation traditionalSignUp(
$email: String!,
$password: String!,
$captchaID: String!,
$captchaAnswer: String!
) {
traditionalSignUp(
email: $email,
password: $password,
captchaID: $captchaID,
captchaAnswer: $captchaAnswer
) {
token
user {
...UserFragment
}
}
}
Variables
{
"email": "abc123",
"password": "abc123",
"captchaID": "xyz789",
"captchaAnswer": "abc123"
}
Response
{
"data": {
"traditionalSignUp": {
"token": "xyz789",
"user": User
}
}
}
unfollowUser
Description
取消追蹤使用者
unregisterDevice
Description
取消註冊設備推播通知
unwatchTopic
Description
取消關注話題
updateAdmin
Description
更新管理員帳號
Response
Returns an
Admin
Arguments
| Name | Description |
|---|---|
id -
ID!
|
|
username -
String
|
|
password -
String
|
|
nickname -
String
|
|
permissions -
[AdminPermission!]
|
Example
Query
mutation updateAdmin(
$id: ID!,
$username: String,
$password: String,
$nickname: String,
$permissions: [AdminPermission!]
) {
updateAdmin(
id: $id,
username: $username,
password: $password,
nickname: $nickname,
permissions: $permissions
) {
id
username
nickname
createdAt
permissions
}
}
Variables
{
"id": "507f1f77bcf86cd799439011",
"username": "xyz789",
"password": "xyz789",
"nickname": "abc123",
"permissions": ["USER_MANAGEMENT"]
}
Response
{
"data": {
"updateAdmin": {
"id": "507f1f77bcf86cd799439011",
"username": "abc123",
"nickname": "xyz789",
"createdAt": "2020-01-01T00:00:00.000Z",
"permissions": ["USER_MANAGEMENT"]
}
}
}
updateCategory
Description
(管理後台)修改話題分類
Response
Returns a
Category!
Example
Query
mutation updateCategory(
$id: String!,
$newName: String,
$newImage: Upload
) {
updateCategory(
id: $id,
newName: $newName,
newImage: $newImage
) {
id
name
imageUrl
topicCount
starCount
}
}
Variables
{
"id": "xyz789",
"newName": "xyz789",
"newImage": "File"
}
Response
{
"data": {
"updateCategory": {
"id": "507f1f77bcf86cd799439011",
"name": "abc123",
"imageUrl": "https://example.com/exmaple",
"topicCount": 27,
"starCount": 27
}
}
}
updateEmail
Description
修改電子郵件信箱
Response
Returns a
Boolean!
Example
Query
mutation updateEmail(
$oldEmail: String!,
$newEmail: String!,
$password: String!
) {
updateEmail(
oldEmail: $oldEmail,
newEmail: $newEmail,
password: $password
)
}
Variables
{
"oldEmail": "xyz789",
"newEmail": "xyz789",
"password": "abc123"
}
Response
{"data": {"updateEmail": true}}
updatePassword
Description
修改登入密碼
Example
Query
mutation updatePassword(
$newPassword: String!,
$oldPassword: String!
) {
updatePassword(
newPassword: $newPassword,
oldPassword: $oldPassword
)
}
Variables
{
"newPassword": "abc123",
"oldPassword": "xyz789"
}
Response
{"data": {"updatePassword": true}}
updateTopic
Description
更新話題
Example
Query
mutation updateTopic(
$id: ID!,
$title: String,
$categoryId: String
) {
updateTopic(
id: $id,
title: $title,
categoryId: $categoryId
) {
id
title
author {
...UserFragment
}
category {
...CategoryFragment
}
options {
...OptionFragment
}
isVoted
voteCount
isSaved
createdAt
comments {
...CommentConnectionFragment
}
isWatching
}
}
Variables
{
"id": "507f1f77bcf86cd799439011",
"title": "abc123",
"categoryId": "xyz789"
}
Response
{
"data": {
"updateTopic": {
"id": "507f1f77bcf86cd799439011",
"title": "abc123",
"author": User,
"category": Category,
"options": [Option],
"isVoted": true,
"voteCount": 27,
"isSaved": false,
"createdAt": "2020-01-01T00:00:00.000Z",
"comments": CommentConnection,
"isWatching": false
}
}
}
updateUserNotificationSetting
Description
更新使用者的通知設定
Response
Returns a
Boolean!
Arguments
| Name | Description |
|---|---|
settings -
UserNotificationSettingInput!
|
Example
Query
mutation updateUserNotificationSetting($settings: UserNotificationSettingInput!) {
updateUserNotificationSetting(settings: $settings)
}
Variables
{"settings": UserNotificationSettingInput}
Response
{"data": {"updateUserNotificationSetting": false}}
updateUserProfile
Description
更新使用者的個人資訊
Response
Returns a
User!
Example
Query
mutation updateUserProfile(
$id: ID!,
$email: String,
$name: String,
$image: Upload
) {
updateUserProfile(
id: $id,
email: $email,
name: $name,
image: $image
) {
id
name
avatarUrl
email
registeredAt
topicCount
commentedCount
commentCount
savedCount
votedCount
followerCount
followingCount
appleIdentifier
googleIdentifier
facebookIdentifier
lineIdentifier
isFollowing
watchingTopicIDs
notificationSettings {
...UserNotificationSettingsFragment
}
}
}
Variables
{
"id": "507f1f77bcf86cd799439011",
"email": "xyz789",
"name": "abc123",
"image": "File"
}
Response
{
"data": {
"updateUserProfile": {
"id": "507f1f77bcf86cd799439011",
"name": "xyz789",
"avatarUrl": "https://example.com/exmaple",
"email": "abc123",
"registeredAt": "2020-01-01T00:00:00.000Z",
"topicCount": 27,
"commentedCount": 27,
"commentCount": 27,
"savedCount": 27,
"votedCount": 27,
"followerCount": 27,
"followingCount": 27,
"appleIdentifier": "abc123",
"googleIdentifier": "abc123",
"facebookIdentifier": "abc123",
"lineIdentifier": "xyz789",
"isFollowing": true,
"watchingTopicIDs": [
"507f1f77bcf86cd799439011"
],
"notificationSettings": UserNotificationSettings
}
}
}
voteTopic
Description
對話題的某個選項投票
Example
Query
mutation voteTopic(
$topicId: String!,
$optionId: String!
) {
voteTopic(
topicId: $topicId,
optionId: $optionId
)
}
Variables
{
"topicId": "abc123",
"optionId": "xyz789"
}
Response
{"data": {"voteTopic": false}}
watchTopic
Description
關注話題
Types
Admin
Fields
| Field Name | Description |
|---|---|
id -
ID!
|
|
username -
String!
|
管理員帳號 |
nickname -
String!
|
管理員使用者名稱 |
createdAt -
String!
|
管理員帳號創建日期 |
permissions -
[AdminPermission!]!
|
管理員權限 |
Example
{
"id": "507f1f77bcf86cd799439011",
"username": "abc123",
"nickname": "xyz789",
"createdAt": "2020-01-01T00:00:00.000Z",
"permissions": ["USER_MANAGEMENT"]
}
AdminConnection
Fields
| Field Name | Description |
|---|---|
edges -
[AdminEdge!]!
|
|
pageInfo -
PageInfo!
|
Example
{
"edges": [AdminEdge],
"pageInfo": PageInfo
}
AdminEdge
AdminLoginResponse
AdminPermission
Values
| Enum Value | Description |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example
"USER_MANAGEMENT"
Boolean
Description
The Boolean scalar type represents true or false.
Example
true
Category
CategoryConnection
Fields
| Field Name | Description |
|---|---|
edges -
[CategoryEdge!]!
|
|
pageInfo -
PageInfo!
|
Example
{
"edges": [CategoryEdge],
"pageInfo": PageInfo
}
CategoryEdge
Comment
CommentConnection
Fields
| Field Name | Description |
|---|---|
edges -
[CommentEdge!]!
|
|
pageInfo -
PageInfo!
|
Example
{
"edges": [CommentEdge],
"pageInfo": PageInfo
}
CommentEdge
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
"507f1f77bcf86cd799439011"
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
27
LoginResponse
Notification
Example
{
"id": "507f1f77bcf86cd799439011",
"createdAt": "2020-01-01T00:00:00.000Z",
"content": "abc123",
"receiverId": "507f1f77bcf86cd799439011",
"isRead": false,
"imageUrl": "https://example.com/exmaple",
"uri": "abc123"
}
NotificationConnection
Fields
| Field Name | Description |
|---|---|
edges -
[NotificationEdge!]!
|
|
pageInfo -
PageInfo!
|
Example
{
"edges": [NotificationEdge],
"pageInfo": PageInfo
}
NotificationEdge
Fields
| Field Name | Description |
|---|---|
node -
Notification!
|
|
cursor -
ID!
|
Example
{
"node": Notification,
"cursor": "507f1f77bcf86cd799439011"
}
NotificationTask
Description
管理員手動排程發送推播通知
Example
{
"id": "507f1f77bcf86cd799439011",
"title": "abc123",
"content": "abc123",
"createdAt": "2020-01-01T00:00:00.000Z",
"createdBy": "507f1f77bcf86cd799439011",
"time": "abc123",
"cancelAt": "2020-01-01T00:00:00.000Z"
}
NotificationTaskConnection
Fields
| Field Name | Description |
|---|---|
edges -
[NotificationTaskEdge!]!
|
|
pageInfo -
PageInfo!
|
Example
{
"edges": [NotificationTaskEdge],
"pageInfo": PageInfo
}
NotificationTaskEdge
Fields
| Field Name | Description |
|---|---|
node -
NotificationTask!
|
|
cursor -
ID!
|
Example
{
"node": NotificationTask,
"cursor": "507f1f77bcf86cd799439011"
}
OAuthProvider
Values
| Enum Value | Description |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
Example
"GOOGLE"
Option
Example
{
"id": "507f1f77bcf86cd799439011",
"name": "xyz789",
"imageUrl": "https://example.com/exmaple",
"backgroundColor": ["xyz789"],
"voteCount": 27,
"isVoted": false
}
OptionInput
PageInfo
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
"xyz789"
Topic
Fields
| Field Name | Description |
|---|---|
id -
ID!
|
|
title -
String!
|
|
author -
User!
|
|
category -
Category!
|
|
options -
[Option!]!
|
話題的選項 |
isVoted -
Boolean!
|
當前使用者是否投了這個話題 |
voteCount -
Int!
|
選項被投票的總次數 |
isSaved -
Boolean!
|
話題是否被當前使用者收藏 |
createdAt -
String!
|
|
comments -
CommentConnection!
|
|
isWatching -
Boolean!
|
是否被當前使用者關注(關注代表會收到該話題的通知) |
Example
{
"id": "507f1f77bcf86cd799439011",
"title": "xyz789",
"author": User,
"category": Category,
"options": [Option],
"isVoted": false,
"voteCount": 27,
"isSaved": true,
"createdAt": "2020-01-01T00:00:00.000Z",
"comments": CommentConnection,
"isWatching": false
}
TopicConnection
Fields
| Field Name | Description |
|---|---|
edges -
[TopicEdge!]!
|
|
pageInfo -
PageInfo!
|
Example
{
"edges": [TopicEdge],
"pageInfo": PageInfo
}
TopicEdge
Upload
Example
"File"
User
Fields
| Field Name | Description |
|---|---|
id -
ID!
|
|
name -
String!
|
|
avatarUrl -
String!
|
|
email -
String!
|
|
registeredAt -
String!
|
|
topicCount -
Int!
|
使用者發表的話題數量 |
commentedCount -
Int!
|
使用者所有話題被留言的次數總和 |
commentCount -
Int!
|
使用者所有話題的留言數量總和 |
savedCount -
Int!
|
使用者話題被收藏的次數總和 |
votedCount -
Int!
|
使用者所有話題被投票的次數總和 |
followerCount -
Int!
|
粉絲數量 |
followingCount -
Int!
|
追蹤中的使用者數量 |
appleIdentifier -
String
|
使用者綁定的 Apple 唯一標識符 |
googleIdentifier -
String
|
使用者綁定的 Google 唯一標識符 |
facebookIdentifier -
String
|
使用者綁定的 Facebook 唯一標識符 |
lineIdentifier -
String
|
使用者綁定的 Line 唯一標識符 |
isFollowing -
Boolean!
|
使用者是否被當前查詢的使用者追蹤 |
watchingTopicIDs -
[ID!]!
|
使用者當前關注(會收到通知)的話題 ID 列表 |
notificationSettings -
UserNotificationSettings!
|
使用者當前的通知設定 |
Example
{
"id": "507f1f77bcf86cd799439011",
"name": "xyz789",
"avatarUrl": "https://example.com/exmaple",
"email": "xyz789",
"registeredAt": "2020-01-01T00:00:00.000Z",
"topicCount": 27,
"commentedCount": 27,
"commentCount": 27,
"savedCount": 27,
"votedCount": 27,
"followerCount": 27,
"followingCount": 27,
"appleIdentifier": "abc123",
"googleIdentifier": "abc123",
"facebookIdentifier": "abc123",
"lineIdentifier": "abc123",
"isFollowing": false,
"watchingTopicIDs": [
"507f1f77bcf86cd799439011"
],
"notificationSettings": UserNotificationSettings
}
UserConnection
Fields
| Field Name | Description |
|---|---|
edges -
[UserEdge!]!
|
|
pageInfo -
PageInfo!
|
Example
{
"edges": [UserEdge],
"pageInfo": PageInfo
}
UserEdge
UserNotificationSettingInput
UserNotificationSettings
Example
{
"allComments": false,
"votedTopicBeingVoted": false,
"votedTopicBeingCommented": false,
"votedTopicBeingSaved": true
}