diff --git a/backend/src/bootstrap/directives.js b/backend/src/bootstrap/directives.js deleted file mode 100644 index 93a7574fb..000000000 --- a/backend/src/bootstrap/directives.js +++ /dev/null @@ -1,12 +0,0 @@ -import { - GraphQLLowerCaseDirective, - GraphQLTrimDirective, - GraphQLDefaultToDirective, -} from 'graphql-custom-directives' - -export default function applyDirectives(augmentedSchema) { - const directives = [GraphQLLowerCaseDirective, GraphQLTrimDirective, GraphQLDefaultToDirective] - augmentedSchema._directives.push.apply(augmentedSchema._directives, directives) - - return augmentedSchema -} diff --git a/backend/src/bootstrap/scalars.js b/backend/src/bootstrap/scalars.js deleted file mode 100644 index eb6d3739b..000000000 --- a/backend/src/bootstrap/scalars.js +++ /dev/null @@ -1,9 +0,0 @@ -import { GraphQLDate, GraphQLTime, GraphQLDateTime } from 'graphql-iso-date' - -export default function applyScalars(augmentedSchema) { - augmentedSchema._typeMap.Date = GraphQLDate - augmentedSchema._typeMap.Time = GraphQLTime - augmentedSchema._typeMap.DateTime = GraphQLDateTime - - return augmentedSchema -} diff --git a/backend/src/schema/index.js b/backend/src/schema/index.js index b1bd36451..695e448b3 100644 --- a/backend/src/schema/index.js +++ b/backend/src/schema/index.js @@ -1,56 +1,46 @@ import { makeAugmentedSchema } from 'neo4j-graphql-js' -import CONFIG from './../config' -import applyScalars from './../bootstrap/scalars' -import applyDirectives from './../bootstrap/directives' import typeDefs from './types' import resolvers from './resolvers' -export default applyScalars( - applyDirectives( - makeAugmentedSchema({ - typeDefs, - resolvers, - config: { - query: { - exclude: [ - 'Badge', - 'Embed', - 'InvitationCode', - 'EmailAddress', - 'Notfication', - 'Statistics', - 'LoggedInUser', - 'Location', - 'SocialMedia', - 'NOTIFIED', - 'REPORTED', - 'Donations', - ], - // add 'User' here as soon as possible - }, - mutation: { - exclude: [ - 'Badge', - 'Embed', - 'InvitationCode', - 'EmailAddress', - 'Notfication', - 'Post', - 'Comment', - 'Statistics', - 'LoggedInUser', - 'Location', - 'SocialMedia', - 'User', - 'EMOTED', - 'NOTIFIED', - 'REPORTED', - 'Donations', - ], - // add 'User' here as soon as possible - }, - debug: !!CONFIG.DEBUG, - }, - }), - ), -) +export default makeAugmentedSchema({ + typeDefs, + resolvers, + config: { + query: { + exclude: [ + 'Badge', + 'Embed', + 'InvitationCode', + 'EmailAddress', + 'Notfication', + 'Statistics', + 'LoggedInUser', + 'Location', + 'SocialMedia', + 'NOTIFIED', + 'REPORTED', + ], + // add 'User' here as soon as possible + }, + mutation: { + exclude: [ + 'Badge', + 'Embed', + 'InvitationCode', + 'EmailAddress', + 'Notfication', + 'Post', + 'Comment', + 'Statistics', + 'LoggedInUser', + 'Location', + 'SocialMedia', + 'User', + 'EMOTED', + 'NOTIFIED', + 'REPORTED', + ], + // add 'User' here as soon as possible + }, + }, +})