https://github.com/jagi/jest-transform-graphql
https://github.com/jagi/jest-transform-graphql
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/jagi/jest-transform-graphql
- Owner: jagi
- License: mit
- Created: 2018-12-24T11:06:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-01-23T10:56:54.000Z (over 6 years ago)
- Last Synced: 2024-11-15T01:42:42.087Z (over 1 year ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @jagi/jest-transform-graphql
This package allows you to import your GraphQL queries directly from the \*.gql files in Jest.
```js
import USER_QUERY from "./graphql/userQuery.gql";
```
## Usage
In your `package.json` file:
```js
{
/* ... */
"jest": {
"transform": {
"\\.(gql|graphql)$": "@jagi/jest-transform-graphql"
/* ... */
}
}
}
```
Or in your `jest.config.js` file:
```js
module.exports = {
transform: {
"\\.(gql|graphql)$": "@jagi/jest-transform-graphql"
/* ... */
}
/* ... */
};
```