@apollo/utils.stripsensitiveliterals
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

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: ["", "", ""]) 
  }
*/

Package Sidebar

Install

npm i @apollo/utils.stripsensitiveliterals

Weekly Downloads

1,306,465

Version

3.0.0

License

MIT

Unpacked Size

9.43 kB

Total Files

10

Last publish

Collaborators

  • dkuc
  • glasser
  • trevor.scheer
  • apollo-bot