All Projects → remind101 → jest-transform-graphql

remind101 / jest-transform-graphql

Licence: MIT license
Make .graphql file importing work in Jest

Programming Languages

javascript
184084 projects - #8 most used programming language

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].