jest-transform-graphql

2.1.0 • Public • Published

jest-transform-graphql

graphql-tag loader for Webpack lets you keep GraphQL queries in separate files.

This lib makes those work in Jest.

Usage

In your package.json,

  "jest": {
    "transform": {
      "\\.(gql|graphql)$": "jest-transform-graphql",
      ".*": "babel-jest"
    }

You have to include the .* matcher because once you define the transform property, it overrides that default.

For more on configuring Jest mappers, see Jest's Webpack tutorial.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.1.0
    150,304
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.1.0
    150,304
  • 2.0.0
    0
  • 1.0.0
    6

Package Sidebar

Install

npm i jest-transform-graphql

Weekly Downloads

150,310

Version

2.1.0

License

ISC

Last publish

Collaborators