UNPKG

@aikidosec/firewall

Version:

Zen by Aikido is an embedded Web Application Firewall that autonomously protects Node.js apps against common and critical attacks

17 lines (16 loc) 480 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.extractInputsFromDocument = extractInputsFromDocument; /** * This function extracts user inputs (that could be harmful) from a GraphQL document. * @returns An array of user inputs. */ function extractInputsFromDocument(document, visitFn) { const inputs = []; visitFn(document, { StringValue(node) { inputs.push(node.value); }, }); return inputs; }