From e5e708908db9b2ba7d515460d7b02674f337ca83 Mon Sep 17 00:00:00 2001 From: Mike Williamson Date: Tue, 4 Dec 2018 15:57:09 +0000 Subject: [PATCH] Move Report type to it's own file. (#62) --- api/src/Report.js | 21 +++++++++++++++++++++ api/src/schema.js | 19 +------------------ 2 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 api/src/Report.js diff --git a/api/src/Report.js b/api/src/Report.js new file mode 100644 index 000000000..f6adc29d4 --- /dev/null +++ b/api/src/Report.js @@ -0,0 +1,21 @@ +const { GraphQLObjectType, GraphQLString } = require('graphql') + +const Report = new GraphQLObjectType({ + name: 'Report', + fields: () => ({ + whatHappened: { + type: GraphQLString, + }, + whatWasInvolved: { + type: GraphQLString, + }, + whatWasInvolvedOther: { + type: GraphQLString, + }, + howWereYouAffected: { + type: GraphQLString, + }, + }), +}) + +module.exports.Report = Report diff --git a/api/src/schema.js b/api/src/schema.js index c57dc47d7..f347f2d04 100644 --- a/api/src/schema.js +++ b/api/src/schema.js @@ -1,23 +1,6 @@ const { GraphQLSchema, GraphQLObjectType, GraphQLString } = require('graphql') const { Stats } = require('./Stats') - -var Report = new GraphQLObjectType({ - name: 'Report', - fields: () => ({ - whatHappened: { - type: GraphQLString, - }, - whatWasInvolved: { - type: GraphQLString, - }, - whatWasInvolvedOther: { - type: GraphQLString, - }, - howWereYouAffected: { - type: GraphQLString, - }, - }), -}) +const { Report } = require('./Report') const query = new GraphQLObjectType({ name: 'Query',