INNER CODE UNIT · TypeScript

setMultiplier

Escape-Technologies/graphql-armor · packages/plugins/cost-limit/src/index.ts:149

              setMultiplier = Math.max(parseInt(arg.value.value, 10) ?? 1, setMultiplier);
            }
            break;
          }
        }
      }

      for (const child of node.selectionSet.selections) {
        if (
          this.config.flattenFragments &&
          (child.kind === Kind.INLINE_FRAGMENT || child.kind === Kind.FRAGMENT_SPREAD)
        ) {
          cost += this.computeComplexity(child, depth);
        } else {
          cost += this.config.depthCostFactor * this.computeComplexity(child, depth + 1);
        }
      }
      // Apply setMultiplier to the total cost of current node and its children

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…