From cd3957bfba0ab7c15a781345c5960eb64f07e184 Mon Sep 17 00:00:00 2001 From: petruki <31597636+petruki@users.noreply.github.com> Date: Sat, 18 Nov 2023 13:45:32 -0800 Subject: [PATCH] Removed unnecessary resolver from GraphQL args query --- src/client/configuration-type.js | 18 +++--------------- src/client/schema.js | 7 +------ 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/src/client/configuration-type.js b/src/client/configuration-type.js index 1c431ed..1b96851 100644 --- a/src/client/configuration-type.js +++ b/src/client/configuration-type.js @@ -91,11 +91,7 @@ export const configType = new GraphQLObjectType({ type: GraphQLString }, activated: { - type: GraphQLBoolean, - resolve: (source, _args, { environment }) => { - return source.activated[`${environment}`] === undefined ? - source.activated[`${EnvType.DEFAULT}`] : source.activated[`${environment}`]; - } + type: GraphQLBoolean } }, resolve: async (source, { _id, strategy, operation, activated }, context) => { @@ -146,11 +142,7 @@ export const groupConfigType = new GraphQLObjectType({ type: GraphQLString }, activated: { - type: GraphQLBoolean, - resolve: (source, _args, { environment }) => { - return source.activated[`${environment}`] === undefined ? - source.activated[`${EnvType.DEFAULT}`] : source.activated[`${environment}`]; - } + type: GraphQLBoolean } }, resolve: async (source, { _id, key, activated }, context) => { @@ -215,11 +207,7 @@ export const domainType = new GraphQLObjectType({ type: GraphQLString }, activated: { - type: GraphQLBoolean, - resolve: (source, _args, { environment }) => { - return source.activated[`${environment}`] === undefined ? - source.activated[`${EnvType.DEFAULT}`] : source.activated[`${environment}`]; - } + type: GraphQLBoolean } }, resolve: async (source, { _id, name, activated }, context) => { diff --git a/src/client/schema.js b/src/client/schema.js index 270f810..bf0561e 100644 --- a/src/client/schema.js +++ b/src/client/schema.js @@ -1,6 +1,5 @@ import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLList, GraphQLBoolean, GraphQLNonNull } from 'graphql'; import { domainType, flatConfigurationType } from './configuration-type'; -import { EnvType } from '../models/environment'; import { strategyInputType, criteriaType } from './criteria-type'; import { resolveConfigByKey, resolveDomain } from './resolvers'; import { resolveConfiguration } from './configuration-resolvers'; @@ -39,11 +38,7 @@ const queryType = new GraphQLObjectType({ type: GraphQLString }, activated: { - type: GraphQLBoolean, - resolve: (source, _args, { environment }) => { - return source.activated.get(environment) === undefined ? - source.activated.get(EnvType.DEFAULT) : source.activated.get(environment); - } + type: GraphQLBoolean }, environment: { type: GraphQLString