mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
801 lines
13 KiB
801 lines
13 KiB
3 years ago
|
---
|
||
|
title: 'GraphQL APIs'
|
||
|
position: 2
|
||
|
category: 'API'
|
||
|
fullscreen: true
|
||
|
menuTitle: 'GraphQL APIs'
|
||
|
---
|
||
|
# Features
|
||
|
* APIs
|
||
|
* Generates GraphQL APIs for **ANY** MySql, Postgres, MSSQL, Sqlite database :fire:
|
||
|
* Serves GraphQL queries irrespective of naming conventions of primary keys, foreign keys, tables etc :fire:
|
||
|
* Support for composite primary keys :fire:
|
||
|
* Usual suspects : CRUD, List, FindOne, Count, Exists, Distinct
|
||
|
* Pagination
|
||
|
* Sorting
|
||
|
* Column filtering - Fields :fire:
|
||
|
* Row filtering - Where :fire:
|
||
|
* Bulk insert, Bulk delete, Bulk read :fire:
|
||
|
* Relations - automatically detected
|
||
|
* Aggregate functions
|
||
|
* More
|
||
|
* Upload single file
|
||
|
* Upload multiple files
|
||
|
* Download file
|
||
|
* Authentication
|
||
|
* Access Control
|
||
|
|
||
|
|
||
|
# GraphQL API Overview
|
||
|
|
||
|
### Query
|
||
|
|
||
|
| **Resolver** | **Arguments** | **Returns** | **Description** |
|
||
|
|---|---|---|---|
|
||
|
| [TableName**List**](#tablenamelist) | where: String, limit: Int, offset: Int, sort: String | [TableName] | List of table rows |
|
||
|
| [TableName**Read**](#tablenameread) | id:String | TableName | Get row by primary key |
|
||
|
| [TableName**Exists**](#tablenameexists) | id: String | Boolean | Check row exists by primary key |
|
||
|
| [TableName**FindOne**](#tablenamefindone) | where: String | TableName | Find row by where conditions |
|
||
|
| [TableName**Count**](#tablenamecount) | where: String | Int | Get rows count |
|
||
|
| [TableName**Distinct**](#tablenamedistinct) | columnName: String, where: String, limit: Int, offset: Int, sort: String | [TableName] | Get distinct rows based on provided column names |
|
||
|
| [TableName**GroupBy**](#tablenamegroupby) | fields: String, having: String, limit: Int, offset: Int, sort: String | [TableNameGroupBy] | Group rows by provided columns |
|
||
|
| [TableName**Aggregate**](#tablenameaggregate) | columnName: String!, having: String, limit: Int, offset: Int, sort: String, func: String! | [TableNameAggregate] | Do aggregation based on provided column name aggregate function |
|
||
|
| [TableName**Distribution**](#tablenamedistribution) | min: Int, max: Int, step: Int, steps: String, columnName: String! | [distribution] | Get distributed list |
|
||
|
|
||
|
|
||
|
### Mutations
|
||
|
|
||
|
| **Resolver** | **Arguments** | **Returns** | **Description** |
|
||
|
|---|---|---|---|
|
||
|
| [TableName**Create**](#tablenamecreate) | data:TableNameInput | TableName | Insert row into table |
|
||
|
| [TableName**Update**](#tablenameupdate) | id:String,data:TableNameInput | TableName | Update table row using primary key |
|
||
|
| [TableName**Delete**](#tablenamedelete) | id:String | TableName | Delete table row using primary id |
|
||
|
| [TableName**CreateBulk**](#tabelenamecreatebulk) | data: [TableNameInput] | [Int] | Bulk row insert |
|
||
|
| [TableName**UpdateBulk**](#tablenamebulk) | data: [TableNameInput] | [Int] | Bulk row update |
|
||
|
| [TableName**DeleteBulk**](#tablenamedeletebulk) | data: [TableNameInput] | [Int] | Bulk row delete |
|
||
|
|
||
|
## Query Arguments
|
||
|
|
||
|
| **Param** | **Description** | **Default value** |**Example Value**|
|
||
|
|---|---|---|---|
|
||
|
| where | Logical Expression | | `(colName,eq,colValue)~or(colName2,gt,colValue2)` <br />[Usage: Comparison operators](#comparison-operators) <br />[Usage: Logical operators](#logical-operators) |
|
||
|
| limit | Number of rows to get(SQL limit value) | 10 | 20 |
|
||
|
| offset | Offset for pagination(SQL offset value) | 0 | 20 |
|
||
|
| sort | Sort column name, where use `-` as prefix for descending sort | | column_name |
|
||
|
| fields | Required column names in result | * | column_name_1,column_name_2 |
|
||
|
|
||
|
#### Comparison operators
|
||
|
|
||
|
```
|
||
|
eq - '=' - (colName,eq,colValue)
|
||
|
not - '!=' - (colName,ne,colValue)
|
||
|
gt - '>' - (colName,gt,colValue)
|
||
|
ge - '>=' - (colName,ge,colValue)
|
||
|
lt - '<' - (colName,lt,colValue)
|
||
|
le - '<=' - (colName,le,colValue)
|
||
|
is - 'is' - (colName,is,true/false/null)
|
||
|
isnot - 'is not' - (colName,isnot,true/false/null)
|
||
|
in - 'in' - (colName,in,val1,val2,val3,val4)
|
||
|
btw - 'between' - (colName,btw,val1,val2)
|
||
|
nbtw - 'not between'- (colName,nbtw,val1,val2)
|
||
|
like - 'like' - (colName,like,%name)
|
||
|
```
|
||
|
|
||
|
#### Example use of comparison operators - complex example
|
||
|
```
|
||
|
PaymentList(where:"(checkNumber,eq,JM555205)~or((amount,gt,200)~and(amount,lt,2000))")
|
||
|
```
|
||
|
|
||
|
|
||
|
#### Logical operators
|
||
|
```
|
||
|
~or - 'or'
|
||
|
~and - 'and'
|
||
|
~not - 'not'
|
||
|
```
|
||
|
|
||
|
### TableNameList
|
||
3 years ago
|
|
||
|
<code-group>
|
||
|
<code-block label="Request" active>
|
||
|
|
||
3 years ago
|
```
|
||
3 years ago
|
CountryList {
|
||
3 years ago
|
country_id
|
||
|
country
|
||
|
last_update
|
||
3 years ago
|
}
|
||
3 years ago
|
```
|
||
3 years ago
|
</code-block>
|
||
|
<code-block label="Response">
|
||
|
|
||
3 years ago
|
```json
|
||
|
{
|
||
|
"data": {
|
||
|
"CountryList": [
|
||
|
{
|
||
|
"country_id": 1,
|
||
|
"country": "Afghanistan",
|
||
|
"last_update": "1139978640000",
|
||
|
"CityCount": 1
|
||
|
},
|
||
|
{
|
||
|
"country_id": 2,
|
||
|
"country": "Algeria",
|
||
|
"last_update": "1139978640000",
|
||
|
"CityCount": 3
|
||
|
},
|
||
|
{
|
||
|
"country_id": 3,
|
||
|
"country": "American Samoa",
|
||
|
"last_update": "1139978640000",
|
||
|
"CityCount": 1
|
||
|
}
|
||
3 years ago
|
]
|
||
|
}
|
||
3 years ago
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
</code-group>
|
||
3 years ago
|
|
||
|
|
||
|
#### List + where
|
||
3 years ago
|
<code-group>
|
||
|
<code-block label="Request" active>
|
||
|
|
||
3 years ago
|
```
|
||
|
{
|
||
|
CountryList(where:"(country,like,United%)") {
|
||
|
country_id
|
||
|
country
|
||
|
last_update
|
||
|
CityCount
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
<code-block label="Response">
|
||
|
|
||
3 years ago
|
```json
|
||
|
{
|
||
|
"data": {
|
||
|
"CountryList": [
|
||
|
{
|
||
|
"country_id": 101,
|
||
|
"country": "United Arab Emirates",
|
||
|
"last_update": "1139958840000",
|
||
|
"CityCount": 3
|
||
|
},
|
||
|
{
|
||
|
"country_id": 102,
|
||
|
"country": "United Kingdom",
|
||
|
"last_update": "1139958840000",
|
||
|
"CityCount": 8
|
||
|
},
|
||
|
{
|
||
|
"country_id": 103,
|
||
|
"country": "United States",
|
||
|
"last_update": "1139958840000",
|
||
|
"CityCount": 35
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
```
|
||
3 years ago
|
</code-block>
|
||
|
</code-group>
|
||
3 years ago
|
|
||
|
|
||
3 years ago
|
[Usage : comparison operators](#comparison-operators)
|
||
3 years ago
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
3 years ago
|
#### List + where + sort
|
||
|
<code-group>
|
||
|
<code-block label="Request" active>
|
||
|
|
||
3 years ago
|
```
|
||
|
{
|
||
|
CountryList(where:"(country,like,United%)",sort:"-country") {
|
||
|
country_id
|
||
|
country
|
||
|
last_update
|
||
|
CityCount
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
<code-block label="Response">
|
||
|
|
||
3 years ago
|
```json
|
||
|
{
|
||
|
"data": {
|
||
|
"CountryList": [
|
||
|
{
|
||
|
"country_id": 103,
|
||
|
"country": "United States",
|
||
|
"last_update": "1139958840000",
|
||
|
"CityCount": 35
|
||
|
},
|
||
|
{
|
||
|
"country_id": 102,
|
||
|
"country": "United Kingdom",
|
||
|
"last_update": "1139958840000",
|
||
|
"CityCount": 8
|
||
|
},
|
||
|
{
|
||
|
"country_id": 101,
|
||
|
"country": "United Arab Emirates",
|
||
|
"last_update": "1139958840000",
|
||
|
"CityCount": 3
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
```
|
||
3 years ago
|
</code-block>
|
||
|
</code-group>
|
||
3 years ago
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
#### List + where + sort + offset
|
||
3 years ago
|
<code-group>
|
||
|
<code-block label="Request" active>
|
||
|
|
||
3 years ago
|
```
|
||
|
{
|
||
|
CountryList(where:"(country,like,United%)",sort:"-country",offset:1) {
|
||
|
country_id
|
||
|
country
|
||
|
last_update
|
||
|
CityCount
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
<code-block label="Response">
|
||
|
|
||
3 years ago
|
```json
|
||
|
{
|
||
|
"data": {
|
||
|
"CountryList": [
|
||
|
{
|
||
|
"country_id": 102,
|
||
|
"country": "United Kingdom",
|
||
|
"last_update": "1139958840000",
|
||
|
"CityCount": 8
|
||
|
},
|
||
|
{
|
||
|
"country_id": 101,
|
||
|
"country": "United Arab Emirates",
|
||
|
"last_update": "1139958840000",
|
||
|
"CityCount": 3
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
```
|
||
3 years ago
|
</code-block>
|
||
|
</code-group>
|
||
3 years ago
|
|
||
|
|
||
|
|
||
|
|
||
|
#### List + limit
|
||
|
|
||
3 years ago
|
<code-group>
|
||
|
<code-block label="Request" active>
|
||
|
|
||
3 years ago
|
```
|
||
|
{
|
||
|
CountryList(limit:6) {
|
||
|
country
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
<code-block label="Response">
|
||
|
|
||
3 years ago
|
```json
|
||
|
{
|
||
|
"data": {
|
||
|
"CountryList": [
|
||
|
{
|
||
|
"country": "Afghanistan"
|
||
|
},
|
||
|
{
|
||
|
"country": "Algeria"
|
||
|
},
|
||
|
{
|
||
|
"country": "American Samoa"
|
||
|
},
|
||
|
{
|
||
|
"country": "Angola"
|
||
|
},
|
||
|
{
|
||
|
"country": "Anguilla"
|
||
|
},
|
||
|
{
|
||
|
"country": "Argentina"
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
```
|
||
3 years ago
|
</code-block>
|
||
|
</code-group>
|
||
3 years ago
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
3 years ago
|
|
||
|
[⤴](#query)
|
||
3 years ago
|
|
||
|
### TableNameRead
|
||
3 years ago
|
<code-group>
|
||
|
<code-block label="Request" active>
|
||
|
|
||
3 years ago
|
```
|
||
|
CountryRead(id:"1") {
|
||
|
country_id
|
||
|
country
|
||
|
last_update
|
||
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
<code-block label="Response">
|
||
|
|
||
3 years ago
|
```json
|
||
|
"data": {
|
||
|
"CountryRead": {
|
||
|
"country_id": 1,
|
||
|
"country": "Afghanistan",
|
||
|
"last_update": "1139978640000",
|
||
|
"CityCount": 1
|
||
|
}
|
||
|
}
|
||
|
```
|
||
3 years ago
|
</code-block>
|
||
|
</code-group>
|
||
|
|
||
3 years ago
|
|
||
3 years ago
|
[⤴](#query)
|
||
3 years ago
|
|
||
|
### TableNameExists
|
||
3 years ago
|
<code-group>
|
||
|
<code-block label="Request" active>
|
||
|
|
||
3 years ago
|
```
|
||
|
CountryExists(id:"1")
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
<code-block label="Response">
|
||
|
|
||
3 years ago
|
```json
|
||
|
"data": {
|
||
|
"CountryExists": true
|
||
|
}
|
||
|
```
|
||
3 years ago
|
</code-block>
|
||
|
</code-group>
|
||
|
|
||
3 years ago
|
|
||
3 years ago
|
[⤴](#query)
|
||
3 years ago
|
|
||
|
### TableNameFindOne
|
||
3 years ago
|
<code-group>
|
||
|
<code-block label="Request" active>
|
||
|
|
||
3 years ago
|
```
|
||
|
CountryFindOne(where:"(country_id,eq,1)") {
|
||
|
country_id
|
||
|
country
|
||
|
last_update
|
||
|
CityCount
|
||
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
<code-block label="Response">
|
||
|
|
||
3 years ago
|
```json
|
||
|
"data": {
|
||
|
"CountryFindOne": {
|
||
|
"country_id": 1,
|
||
|
"country": "Afghanistan",
|
||
|
"last_update": "1139978640000",
|
||
|
"CityCount": 1
|
||
|
}
|
||
|
}
|
||
|
```
|
||
3 years ago
|
</code-block>
|
||
|
</code-group>
|
||
3 years ago
|
|
||
3 years ago
|
|
||
|
[⤴](#query)
|
||
3 years ago
|
|
||
|
### TableNameCount
|
||
3 years ago
|
<code-group>
|
||
|
<code-block label="Request" active>
|
||
|
|
||
3 years ago
|
```
|
||
|
CountryCount
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
<code-block label="Response">
|
||
|
|
||
3 years ago
|
```json
|
||
3 years ago
|
{
|
||
|
"data": {
|
||
3 years ago
|
"CountryCount": 109
|
||
|
}
|
||
3 years ago
|
}
|
||
3 years ago
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
</code-group>
|
||
|
|
||
|
|
||
|
[⤴](#query)
|
||
3 years ago
|
|
||
|
### TableNameDistinct
|
||
3 years ago
|
<code-group>
|
||
|
<code-block label="Request" active>
|
||
|
|
||
3 years ago
|
```
|
||
|
{
|
||
|
CountryDistinct(columnName:"last_update",limit:3) {
|
||
|
last_update
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
<code-block label="Response">
|
||
|
|
||
3 years ago
|
```json
|
||
|
{
|
||
|
"data": {
|
||
|
"CountryDistinct": [
|
||
|
{
|
||
|
"last_update": "1139958840000"
|
||
|
},
|
||
|
{
|
||
|
"last_update": "1578323893000"
|
||
|
},
|
||
|
{
|
||
|
"last_update": "1578321201000"
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
```
|
||
3 years ago
|
</code-block>
|
||
|
</code-group>
|
||
|
|
||
3 years ago
|
|
||
3 years ago
|
[⤴](#query)
|
||
3 years ago
|
|
||
|
### TableNameGroupBy
|
||
3 years ago
|
<code-group>
|
||
|
<code-block label="Request" active>
|
||
|
|
||
3 years ago
|
```
|
||
|
{
|
||
|
CountryGroupBy(fields:"last_update",limit:1) {
|
||
|
country_id
|
||
|
country
|
||
|
last_update
|
||
|
count
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
<code-block label="Response">
|
||
|
|
||
3 years ago
|
```json
|
||
|
{
|
||
|
"data": {
|
||
|
"CountryGroupBy": [
|
||
|
{
|
||
|
"country_id": null,
|
||
|
"country": null,
|
||
|
"last_update": "1139958840000",
|
||
|
"count": 109
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
```
|
||
3 years ago
|
</code-block>
|
||
|
</code-group>
|
||
3 years ago
|
|
||
3 years ago
|
|
||
|
[⤴](#query)
|
||
3 years ago
|
|
||
|
### TableNameAggregate
|
||
3 years ago
|
<code-group>
|
||
|
<code-block label="Request" active>
|
||
|
|
||
3 years ago
|
```
|
||
|
{
|
||
|
PaymentAggregate(columnName:"amount",func:"min,max,avg,count") {
|
||
|
count
|
||
|
avg
|
||
|
min
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
<code-block label="Response">
|
||
|
|
||
3 years ago
|
```json
|
||
|
{
|
||
|
"data": {
|
||
|
"PaymentAggregate": [
|
||
|
{
|
||
|
"count": 16048,
|
||
|
"avg": 4.200743,
|
||
|
"min": 0
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
[⤴](#query)
|
||
3 years ago
|
|
||
|
### TableNameDistribution
|
||
3 years ago
|
<code-group>
|
||
|
<code-block label="Request" active>
|
||
|
|
||
3 years ago
|
```
|
||
|
{
|
||
|
PaymentDistribution (columnName:"amount"){
|
||
|
range
|
||
|
count
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
<code-block label="Response">
|
||
|
|
||
3 years ago
|
```json
|
||
|
{
|
||
|
"data": {
|
||
|
"PaymentDistribution": [
|
||
|
{
|
||
|
"range": "0-4",
|
||
|
"count": 8302
|
||
|
},
|
||
|
{
|
||
|
"range": "5-8",
|
||
|
"count": 3100
|
||
|
},
|
||
|
{
|
||
|
"range": "9-11.99",
|
||
|
"count": 371
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
</code-group>
|
||
|
|
||
|
[⤴](#mutations)
|
||
3 years ago
|
|
||
|
### TableNameCreate
|
||
3 years ago
|
<code-group>
|
||
|
<code-block label="Request" active>
|
||
|
|
||
3 years ago
|
```
|
||
|
mutation {
|
||
|
CountryCreate(data: {country: "test"}) {
|
||
|
country_id
|
||
|
country
|
||
|
last_update
|
||
|
CityCount
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
<code-block label="Response">
|
||
|
|
||
3 years ago
|
```json
|
||
|
{
|
||
|
"data": {
|
||
|
"CountryCreate": {
|
||
|
"country_id": 10264,
|
||
|
"country": "test",
|
||
|
"last_update": null,
|
||
|
"CityCount": 0
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
</code-group>
|
||
|
|
||
|
[⤴](#mutations)
|
||
3 years ago
|
|
||
|
### TableNameUpdate
|
||
3 years ago
|
<code-group>
|
||
|
<code-block label="Request" active>
|
||
|
|
||
3 years ago
|
```
|
||
|
mutation {
|
||
|
CountryUpdate(data: {country: "test_new"}, id: "10264") {
|
||
|
country_id
|
||
|
country
|
||
|
last_update
|
||
|
CityCount
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
<code-block label="Response">
|
||
|
|
||
3 years ago
|
```json
|
||
|
{
|
||
|
"data": {
|
||
|
"CountryUpdate": {
|
||
|
"country_id": null,
|
||
|
"country": null,
|
||
|
"last_update": null,
|
||
|
"CityCount": null
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
</code-group>
|
||
|
|
||
|
[⤴](#mutations)
|
||
3 years ago
|
|
||
|
### TableNameDelete
|
||
3 years ago
|
<code-group>
|
||
|
<code-block label="Request" active>
|
||
|
|
||
3 years ago
|
```
|
||
|
mutation {
|
||
|
CountryDelete(id: "10264") {
|
||
|
country_id
|
||
|
country
|
||
|
last_update
|
||
|
CityCount
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
<code-block label="Response">
|
||
|
|
||
3 years ago
|
```json
|
||
|
{
|
||
|
"data": {
|
||
|
"CountryDelete": {
|
||
|
"country_id": null,
|
||
|
"country": null,
|
||
|
"last_update": null,
|
||
|
"CityCount": null
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
```
|
||
3 years ago
|
</code-block>
|
||
|
</code-group>
|
||
|
|
||
3 years ago
|
|
||
3 years ago
|
[⤴](#mutations)
|
||
3 years ago
|
|
||
|
### TableNameCreateBulk
|
||
3 years ago
|
<code-group>
|
||
|
<code-block label="Request" active>
|
||
|
|
||
3 years ago
|
```
|
||
|
mutation {
|
||
|
CountryCreateBulk(data:[{country:"test 2"},{country:"test 3"}])
|
||
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
<code-block label="Response">
|
||
|
|
||
3 years ago
|
```json
|
||
|
{
|
||
|
"data": {
|
||
|
"CountryCreateBulk": [
|
||
|
10265
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
```
|
||
3 years ago
|
</code-block>
|
||
|
</code-group>
|
||
|
|
||
3 years ago
|
|
||
3 years ago
|
[⤴](#mutations)
|
||
3 years ago
|
|
||
|
### TableNameUpdateBulk
|
||
3 years ago
|
<code-group>
|
||
|
<code-block label="Request" active>
|
||
|
|
||
3 years ago
|
```
|
||
|
mutation {
|
||
|
CountryUpdateBulk(data: [{country: "test 2", country_id: 10265}, {country: "test 3", country_id: 10266}])
|
||
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
<code-block label="Response">
|
||
|
|
||
3 years ago
|
```json
|
||
|
{
|
||
|
"data": {
|
||
|
"CountryUpdateBulk": [
|
||
|
1,
|
||
|
1
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
```
|
||
3 years ago
|
</code-block>
|
||
|
</code-group>
|
||
3 years ago
|
|
||
3 years ago
|
|
||
|
[⤴](#mutations)
|
||
3 years ago
|
|
||
|
### TableNameDeleteBulk
|
||
3 years ago
|
<code-group>
|
||
|
<code-block label="Request" active>
|
||
|
|
||
3 years ago
|
```
|
||
|
mutation {
|
||
|
CountryDeleteBulk(data: [{country_id: 10265}, {country_id: 10266}])
|
||
|
}
|
||
|
```
|
||
|
|
||
3 years ago
|
</code-block>
|
||
|
<code-block label="Response">
|
||
|
|
||
3 years ago
|
```json
|
||
|
{
|
||
|
"data": {
|
||
|
"CountryDeleteBulk": [
|
||
|
1,
|
||
|
1
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
```
|
||
3 years ago
|
</code-block>
|
||
|
</code-group>
|
||
|
|