Queries

Available queries

Currency - Returns a single currency based on the id provided

query {
  Currency (id: 100012) {
    label
    exchange_rate
  }
}

Currencies - Returns a list of currencies based on the filter define

query {
  Currencies {
    data {
      label
      exchange_rate
      active
    }
  }
}


Available fields

id
Unique identifier of the currency
label
Name of the currency (USD, GBP, ...)
exchange_rate
Currency exchange rate against default currency (1 for the default rate)
default
If true, the rate is the default for the documents created
active
If true, the rate is active and can be used in documents


Filters

You can create filters based on following fields

label
Example:{ "column" : "LABEL", "operator" : "EQ", "value" : "EUR" }
exchange rate
Example: { "column" : "EXCHANGE_RATE", "operator" : "GT", "value" : 1.1 }
default
Example: { "column": "DEFAULT", "operator": "NEQ", "value": true }
active
Example:{ "column": "ACTIVE", "operator": "EQ", "value": true }

Sorting

You can sort data based on following fields : id, label, exchange_rate, default, active

query Currencies(
  $where: QueryCurrenciesWhereWhereConditions, 
) {
  Currencies(
    orderBy: [{column: LABEL, order: ASC}]
    where: $where
  ) {
    paginatorInfo {
      total
    }
    data {
      id
      label
      default
      exchange_rate
    }
  }
}
{
  "where": {
    "AND": [
      {
        "column": "ACTIVE",
        "operator": "EQ",
        "value": true
      }
    ]
  }
}

Example of data returned

{
  "data": {
    "Currencies": {
      "paginatorInfo": {
        "total": 1
      },
      "data": [
        {
          "id": 100002,
          "label": "EUR",
          "default": true,
          "exchange_rate": null
        }
      ]
    }
  }
}