JSPM

@apollo/utils.stripsensitiveliterals

3.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1677636
  • Score
    100M100P100Q194094F
  • License MIT

Remove literals from an AST which might contain PII (strings and numbers, and optionally lists and objects)

Package Exports

  • @apollo/utils.stripsensitiveliterals
  • @apollo/utils.stripsensitiveliterals/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@apollo/utils.stripsensitiveliterals) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

stripSensitiveLiterals

The stripSensitiveLiterals function is used to remove string and numeric literals from a graphql DocumentNode which could be sensitive. Consider using variables instead!

Usage

import { stripSensitiveLiterals } from "@apollo/utils.stripsensitiveliterals";

stripSensitiveLiterals(
  parse(`#graphql
  query User {
    user(name: "Ada Lovelace", age: 31, ids: ["1", "2", "3"]) 
  }
`),
);
/**
  query User {
    user(name: "", age: 0, ids: ["", "", ""]) 
  }
*/