2017-04-28 00:59:03 +03:00
|
|
|
'use strict';
|
|
|
|
|
2017-05-23 00:25:21 +03:00
|
|
|
const Fs = require('fs');
|
|
|
|
const Path = require('path');
|
2017-04-28 00:59:03 +03:00
|
|
|
const Graphql = require('graphql');
|
|
|
|
|
|
|
|
|
|
|
|
const internals = {
|
2017-05-23 00:25:21 +03:00
|
|
|
schema: Fs.readFileSync(Path.join(__dirname, 'schema.gql')).toString()
|
2017-04-28 00:59:03 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
exports.options = (data) => {
|
|
|
|
const schema = Graphql.buildSchema(internals.schema);
|
|
|
|
|
2017-05-23 00:25:21 +03:00
|
|
|
const getPortal = function (args, request) {
|
2017-04-28 00:59:03 +03:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2017-05-23 00:25:21 +03:00
|
|
|
const getDeploymentGroups = function (args, request) {
|
2017-04-28 00:59:03 +03:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2017-05-23 00:25:21 +03:00
|
|
|
const getDeploymentGroup = function (args, request) {
|
2017-04-28 00:59:03 +03:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2017-05-23 00:25:21 +03:00
|
|
|
const getServiceScales = function (args, request) {
|
2017-04-28 00:59:03 +03:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2017-05-23 00:25:21 +03:00
|
|
|
const getServiceScale = function (args, request) {
|
2017-04-28 00:59:03 +03:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
return {
|
|
|
|
schema,
|
|
|
|
endpointURL: '/graphql',
|
|
|
|
rootValue: {
|
2017-05-23 00:25:21 +03:00
|
|
|
portal: getPortal,
|
|
|
|
deploymentGroups: getDeploymentGroups,
|
|
|
|
deploymentGroup: getDeploymentGroup,
|
|
|
|
serviceScales: getServiceScales,
|
|
|
|
serviceScale: getServiceScale
|
2017-04-28 00:59:03 +03:00
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|