@graphql-tools/jest-transform 1.2.0-alpha-b76ec274.0 → 1.2.0-alpha-6c480b2d.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# GraphQL Jest Transform
|
|
2
|
+
|
|
3
|
+
A Jest transformer to preprocess GraphQL Documents (operations, fragments and SDL)
|
|
4
|
+
|
|
5
|
+
yarn add @graphql-tools/jest-transform
|
|
6
|
+
|
|
7
|
+
In your `package.json`:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"jest": {
|
|
12
|
+
"transform": {
|
|
13
|
+
"\\.(gql|graphql)$": "@graphql-tools/jest-transform"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
or `jest.config.js`:
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
module.exports = {
|
|
23
|
+
// ...
|
|
24
|
+
transform: {
|
|
25
|
+
'\\.(gql|graphql)$': '@graphql-tools/jest-transform'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
> How is it different from `jest-transform-graphql`? It doesn't use `graphql-tag/loader` under the hood but our own, more optimized and customisable `@graphql-tools/webpack-loader`.
|
|
31
|
+
|
|
32
|
+
## Options
|
|
33
|
+
|
|
34
|
+
- noDescription (_default: false_) - removes descriptions
|
|
35
|
+
- esModule (_default: false_) - uses import and export statements instead of CommonJS
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"globals": {
|
|
40
|
+
"graphql": {
|
|
41
|
+
"noDescription": true
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/jest-transform",
|
|
3
|
-
"version": "1.2.0-alpha-
|
|
3
|
+
"version": "1.2.0-alpha-6c480b2d.0",
|
|
4
4
|
"description": "Jest Plugin to load and parse imported GraphQL files",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@graphql-tools/webpack-loader": "6.7.0-alpha-
|
|
10
|
+
"@graphql-tools/webpack-loader": "6.7.0-alpha-6c480b2d.0",
|
|
11
11
|
"@jest/transform": "^28.0.0",
|
|
12
12
|
"@jest/types": "^28.0.0",
|
|
13
13
|
"tslib": "^2.4.0"
|