mirror of https://github.com/yldio/copilot.git
20 lines
439 B
JavaScript
20 lines
439 B
JavaScript
const DatacenterType = require('../types/datacenter');
|
|
const graphql = require('graphql');
|
|
const api = require('../../api');
|
|
|
|
const { GraphQLList } = graphql;
|
|
|
|
module.exports = {
|
|
type: new GraphQLList(DatacenterType),
|
|
resolve() {
|
|
return api.datacenters().then(datacenters => {
|
|
return Object.keys(datacenters).map(name => {
|
|
return {
|
|
url: datacenters[name],
|
|
name
|
|
};
|
|
});
|
|
});
|
|
}
|
|
};
|