joyent-portal/packages/cloudapi-gql/src/schema/queries/services.js
Sérgio Ramos 8295bd6882 chore: initial lerna setup
this shall be a progressive process
2017-05-25 10:56:50 +01:00

20 lines
418 B
JavaScript

const ServiceType = require('../types/service');
const graphql = require('graphql');
const api = require('../../api');
const { GraphQLList } = graphql;
module.exports = {
type: new GraphQLList(ServiceType),
resolve() {
return api.services().then(services => {
return Object.keys(services).map(name => {
return {
url: services[name],
name
};
});
});
}
};