graphql-validation-complexity
graphql-validation-complexity copied to clipboard
Unexpected error: RangeError: Maximum call stack size exceeded
@4Catalyzer
import { createComplexityLimitRule } from 'graphql-validation-complexity'; import { ApolloServer } from '@apollo/server'; // I am using latest ApolloServer v4. const ComplexityLimitRule = createComplexityLimitRule(1000);
const apolloServer = new ApolloServer({ gateway, plugins: [ ], validationRules: [ComplexityLimitRule], formatError:TestError, });
The above I use as per the docs but it gives me this error:
Unexpected error: RangeError: Maximum call stack size exceeded
at ValidationContext.getFragment (node_modules/graphql/validation/ValidationContext.js:44:9)
at node_modules/graphql-validation-complexity/lib/ComplexityVisitor.js:128:38
at Array.flatMap (
Is there a way to take care of this error locally at server side or does library needs to be modified ?