From 43f633ce0b32d666b20aeb95e3def71736f90d40 Mon Sep 17 00:00:00 2001 From: JUDIT GRESKOVITS Date: Wed, 3 May 2017 17:36:38 +0100 Subject: [PATCH] Tidy more --- spikes/graphql/graphql-server/src/resolvers.js | 16 ++++++++-------- spikes/graphql/graphql-server/src/schema.js | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/spikes/graphql/graphql-server/src/resolvers.js b/spikes/graphql/graphql-server/src/resolvers.js index b940d81c..f4bc9d23 100644 --- a/spikes/graphql/graphql-server/src/resolvers.js +++ b/spikes/graphql/graphql-server/src/resolvers.js @@ -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: { diff --git a/spikes/graphql/graphql-server/src/schema.js b/spikes/graphql/graphql-server/src/schema.js index 12ebdc0c..aa01072b 100644 --- a/spikes/graphql/graphql-server/src/schema.js +++ b/spikes/graphql/graphql-server/src/schema.js @@ -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({