JSPM

jest-transform-graphql

2.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 123114
  • Score
    100M100P100Q167859F
  • License ISC

Jest transformer for .gql imports

Package Exports

  • jest-transform-graphql

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 (jest-transform-graphql) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.