How to use graphql-crunch - 2 common examples

To help you get started, we’ve selected a few graphql-crunch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github artsy / metaphysics / src / lib / crunchInterceptor.js View on Github external
intercept: (body, send) => {
    body = JSON.parse(body) // eslint-disable-line no-param-reassign
    if (body && body.data) {
      body.data = crunch(body.data) // eslint-disable-line no-param-reassign
    }
    send(JSON.stringify(body))
  },
})
github artsy / metaphysics / src / lib / crunchInterceptor.ts View on Github external
intercept: (body, send) => {
    body = JSON.parse(body) // eslint-disable-line no-param-reassign
    if (body) {
      body = crunch(body) // eslint-disable-line no-param-reassign
      res.set("X-Crunch", "true")
    }
    send(JSON.stringify(body))
  },
})

graphql-crunch

Normalizes GraphQL responses by reducing duplication, resulting in smaller payloads and faster JSON parsing.

MIT
Latest version published 2 years ago

Package Health Score

51 / 100
Full package analysis

Popular graphql-crunch functions