CarTaGraph API Reference
Hasura への 問い合わせクエリ
Terms of Service
API Endpoints
https://example.com/graphql
Queries
getParagraphs
Response
Returns a
paragraphs
Example
Query
query getParagraphs {
getParagraphs {
pid
title
}
}
Response
{
"data": {
"getParagraphs": {
"pid": "abc123",
"title": "xyz789"
}
}
}
getRelation
Response
Returns a
paragraphs_relation
Example
Query
query getRelation {
getRelation {
from
to
}
}
Response
{
"data": {
"getRelation": {
"from": "abc123",
"to": "abc123"
}
}
}
Mutations
UpdateParagraphs
Description
パラグラフとリンクを更新
Response
Returns an
UpdateParagraphs
Example
Query
mutation UpdateParagraphs {
UpdateParagraphs {
delete_paragraphs_relation {
...mutation_responseFragment
}
insert_paragraphs_one {
...insert_paragraphs_one_responseFragment
}
insert_paragraphs_relation {
...mutation_responseFragment
}
}
}
Response
{
"data": {
"UpdateParagraphs": {
"delete_paragraphs_relation": mutation_response,
"insert_paragraphs_one": insert_paragraphs_one_response,
"insert_paragraphs_relation": mutation_response
}
}
}
insert_user_paragraph_history
Description
ユーザのパラグラフ遷移履歴保存
Response
Returns a
mutation_response
Arguments
Name | Description |
---|---|
objects -
[user_paragraph_history!]!
|
|
on_conflict -
user_paragraph_history_on_conflict
|
Example
Query
mutation insert_user_paragraph_history(
$objects: [user_paragraph_history!]!,
$on_conflict: user_paragraph_history_on_conflict
) {
insert_user_paragraph_history(
objects: $objects,
on_conflict: $on_conflict
) {
affected_rows
}
}
Variables
{
"objects": [user_paragraph_history],
"on_conflict": user_paragraph_history_on_conflict
}
Response
{"data": {"insert_user_paragraph_history": {"affected_rows": 123}}}
Types
Boolean
Description
The Boolean
scalar type represents true
or false
.
Example
true
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
987
Paragraph
Relation
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"
UpdateParagraphs
Fields
Field Name | Description |
---|---|
delete_paragraphs_relation -
mutation_response
|
更新前にリンクの削除 |
Arguments
|
|
insert_paragraphs_one -
insert_paragraphs_one_response
|
パラグラフを更新 |
Arguments
|
|
insert_paragraphs_relation -
mutation_response
|
リンクを挿入 |
Arguments
|
Example
{
"delete_paragraphs_relation": mutation_response,
"insert_paragraphs_one": insert_paragraphs_one_response,
"insert_paragraphs_relation": mutation_response
}
deleteWhere
Fields
Input Field | Description |
---|---|
from -
whereEq
|
Example
{"from": whereEq}
insert_paragraphs_one_on_conflict
Fields
Input Field | Description |
---|---|
constraint -
paragraphs_pkey
|
|
update_columns -
paragraph
|
Example
{
"constraint": paragraphs_pkey,
"update_columns": paragraph
}
insert_paragraphs_one_response
Fields
Field Name | Description |
---|---|
pid -
String
|
挿入したパラグラフID |
Example
{"pid": "xyz789"}
insert_paragraphs_relation_onconflict
Fields
Input Field | Description |
---|---|
constraint -
paragraphs_relation_pkey
|
|
update_columns -
[String]
|
Example
{
"constraint": paragraphs_relation_pkey,
"update_columns": ["abc123"]
}
mutation_response
Fields
Field Name | Description |
---|---|
affected_rows -
Int!
|
Example
{"affected_rows": 123}
paragraph
Example
paragraph
paragraphs
paragraphs_pkey
Example
paragraphs_pkey
paragraphs_relation
paragraphs_relation_pkey
Example
paragraphs_relation_pkey
user_paragraph_history
user_paragraph_history_on_conflict
Fields
Input Field | Description |
---|---|
constraint -
user_paragraph_history_pkey
|
|
update_columns -
[String]!
|
全て主キーなので空配列を指定 |
Example
{
"constraint": user_paragraph_history_pkey,
"update_columns": ["abc123"]
}
user_paragraph_history_pkey
Example
user_paragraph_history_pkey
whereEq
Fields
Input Field | Description |
---|---|
_eq -
String
|
Example
{"_eq": "xyz789"}