1
0
mirror of https://github.com/yldio/copilot.git synced 2024-12-01 07:30:07 +02:00

Tidy more

This commit is contained in:
JUDIT GRESKOVITS 2017-05-03 17:36:38 +01:00 committed by Judit Greskovits
parent 9e1c52f1f3
commit 43f633ce0b
2 changed files with 16 additions and 16 deletions

View File

@ -2,7 +2,7 @@ import { find, filter } from 'lodash';
import data from './mock-data';
const portal = { username: 'juditgreskovits', host: 'dockerhost'};
const deployments = data.projects.data;
const deploymentGroups = data.projects.data;
const services = data.services.data;
const instances = data.instances.data;
const metricTypes = data.metrics.data.types;
@ -13,11 +13,11 @@ const resolveFunctions = {
portal() {
return portal;
},
deployments() {
return deployments;
deploymentGroups() {
return deploymentGroups;
},
deployment(_, { uuid }) {
return find(deployments, { uuid: uuid });
deploymentGroup(_, { uuid }) {
return find(deploymentGroups, { uuid: uuid });
},
services() {
return services;
@ -35,9 +35,9 @@ const resolveFunctions = {
return datacenters;
},
},
Deployment: {
services(deployment) {
return filter(services, { project: deployment.uuid })
DeploymentGroup: {
services(deploymentGroup) {
return filter(services, { project: deploymentGroup.uuid })
}
},
Service: {

View File

@ -9,7 +9,7 @@ type Portal {
username: String!
host: String! # dockerhost
datacenter: Datacenter!
deployments: [Deployment]!
deploymentGroups: [DeploymentGroup]!
}
type Version {
@ -17,7 +17,7 @@ type Version {
version: String! # version uuid
}
type Deployment {
type DeploymentGroup {
uuid: String!
name: String!
datacenter: Datacenter!
@ -33,6 +33,7 @@ type DeploymentState {
type Manifest {
uuid: String!
deploymentGoup: String!
created: Date!
type: String!
format: String!
@ -43,6 +44,7 @@ type Manifest {
type Service {
uuid: String!
hash: String!
deploymentGoup: String!
version: Version!
name: String!
instances: [Instance]!
@ -73,6 +75,8 @@ type Package {
type Instance {
uuid: String!
name: String!
deploymentGoup: String!
service: String!
metrics: [InstanceMetric]!
}
@ -95,8 +99,8 @@ type Datacenter {
type Query {
portal: Portal
deployments: [Deployment]
deployment(uuid: String!): Deployment
deploymentGroups: [DeploymentGroup]
deploymentGroup(uuid: String!): DeploymentGroup
services: [Service]
service(uuid: String!): Service
instances: [Instance]
@ -106,10 +110,6 @@ type Query {
datacenters: [Datacenter]
}
type Mutation {
createDeployment: Deployment
}
`;
export default makeExecutableSchema({