@jagi/jest-transform-graphql

1.0.2 • Public • Published

@jagi/jest-transform-graphql

This package allows you to import your GraphQL queries directly from the *.gql files in Jest.

import USER_QUERY from "./graphql/userQuery.gql";

Usage

In your package.json file:

{
  /* ... */
  "jest": {
    "transform": {
      "\\.(gql|graphql)$": "@jagi/jest-transform-graphql"
      /* ... */
    }
  }
}

Or in your jest.config.js file:

module.exports = {
  transform: {
    "^\\.(gql|graphql)$": "@jagi/jest-transform-graphql"
    /* ... */
  }
  /* ... */
};

Readme

Keywords

Package Sidebar

Install

npm i @jagi/jest-transform-graphql

Weekly Downloads

1,428

Version

1.0.2

License

MIT

Unpacked Size

1.32 kB

Total Files

3

Last publish

Collaborators

  • lukejagodzinski