CreateCurrency
Create a currency
Parameters
input - CurrencyInput |
---|
Data of the currency |
Example
mutation CreateCurrency($input: CurrencyInput!) {
CreateCurrency(input: $input) {
id
label
exchange_rate
default
}
}
{
"input": {
"label": "GBP",
"exchange_rate": 1.2,
"default": false
}
}
Returned data
{
"data": {
"CreateCurrency": {
"id": 100010,
"label": "GBP",
"exchange_rate": 1.2,
"default": false
}
}
}
UpdateCurrency
Update a currency
Parameters
id - ID |
---|
Id of the currency |
input - CurrencyInput |
---|
Data of the currency |
Example
mutation UpdateCurrency($id: ID!, $input: CurrencyInput!) {
UpdateCurrency(id: $id, input: $input) {
id
label
exchange_rate
default
}
}
{
"id": 100010,
"input": {
"label": "GBP",
"exchange_rate": 1.3,
"default": false
}
}
Returned data
{
"data": {
"UpdateCurrency": {
"id": 100010,
"label": "GBP",
"exchange_rate": 1.3,
"default": false
}
}
}
DisableCurrency
Disable a currency
Parameters
id - ID |
---|
Id of the currency |
Example
mutation DisableCurrency($id: ID!) {
DisableCurrency(id: $id) {
id
active
}
}
{
"id": 100010
}
Returned data
{
"data": {
"DisableCurrency": {
"id": 100010,
"active": false
}
}
}
EnableCurrency
Enable a currency
Parameters
id - ID |
---|
Id of the currency |
Example
mutation EnableCurrency($id: ID!) {
EnableCurrency(id: $id) {
id
active
}
}
{
"id": 100010
}
Returned data
{
"data": {
"EnableCurrency": {
"id": 100010,
"active": true
}
}
}
CurrencyInput data type
label - String |
---|
Currency ISO code (GBP, USD, ...) |
exchange_rate - Float |
---|
Currency exchange rate against default currency (1 for the default currency) |
default - Boolean |
---|
Set the currency as the default one if true |