feat: add missing types and resolvers
This commit is contained in:
parent
b0417f8375
commit
de98ed4c2c
25 changed files with 127 additions and 12 deletions
21
lib/new-admin/graphql/resolvers/rates.resolver.js
Normal file
21
lib/new-admin/graphql/resolvers/rates.resolver.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
const settingsLoader = require('../../../new-settings-loader')
|
||||
const forex = require('../../../forex')
|
||||
const plugins = require('../../../plugins')
|
||||
|
||||
const resolvers = {
|
||||
Query: {
|
||||
cryptoRates: () =>
|
||||
settingsLoader.loadLatest().then(settings => {
|
||||
const pi = plugins(settings)
|
||||
return pi.getRawRates().then(r => {
|
||||
return {
|
||||
withCommissions: pi.buildRates(r),
|
||||
withoutCommissions: pi.buildRatesNoCommission(r)
|
||||
}
|
||||
})
|
||||
}),
|
||||
fiatRates: () => forex.getFiatRates()
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = resolvers
|
||||
Loading…
Add table
Add a link
Reference in a new issue