vite-plugin-graphql-loader 5.0.0 → 5.0.1
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 +11 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
# vite-plugin-graphql-loader
|
|
2
2
|
|
|
3
|
-

|
|
4
|
-

|
|
5
|
-

|
|
6
|
-

|
|
7
|
-

|
|
8
|
-

|
|
9
|
-
|
|
10
|
-
<!--  -->
|
|
3
|
+
[](https://github.com/0x31/vite-plugin-graphql-loader/blob/master/LICENSE.txt)
|
|
4
|
+
[](https://www.npmjs.com/package/vite-plugin-graphql-loader)
|
|
5
|
+
[](https://www.npmjs.com/package/vite-plugin-graphql-loader)
|
|
6
|
+
[](https://vite.dev)
|
|
7
|
+
[](https://graphql.org)
|
|
8
|
+
[](https://www.typescriptlang.org)
|
|
11
9
|
|
|
12
10
|
A Vite plugin for loading GraphQL .gql and .graphql files, based on [graphql-tag/loader](https://github.com/apollographql/graphql-tag)
|
|
13
11
|
|
|
@@ -16,13 +14,13 @@ This package _doesn't_ generate TypeScript definitions from the queries and frag
|
|
|
16
14
|
## Install
|
|
17
15
|
|
|
18
16
|
```bash
|
|
19
|
-
yarn add -D vite-plugin-graphql-loader
|
|
17
|
+
yarn add -D vite-plugin-graphql-loader graphql
|
|
20
18
|
```
|
|
21
19
|
|
|
22
20
|
or
|
|
23
21
|
|
|
24
22
|
```bash
|
|
25
|
-
npm i vite-plugin-graphql-loader
|
|
23
|
+
npm i --save-dev vite-plugin-graphql-loader graphql
|
|
26
24
|
```
|
|
27
25
|
|
|
28
26
|
## Usage
|
|
@@ -74,14 +72,14 @@ import { FirstQuery, SecondQuery } from "./example.graphql";
|
|
|
74
72
|
|
|
75
73
|
If you are using TypeScript, you will have to declare `.gql` or `.graphql` files.
|
|
76
74
|
|
|
77
|
-
Create `graphql.d.ts` anywhere in your source directory
|
|
75
|
+
Create `graphql.d.ts` anywhere in your source directory:
|
|
78
76
|
|
|
79
77
|
```typescript
|
|
80
78
|
declare module "*.gql";
|
|
81
79
|
declare module "*.graphql";
|
|
82
80
|
```
|
|
83
81
|
|
|
84
|
-
**_Alternatively_**,
|
|
82
|
+
**_Alternatively_**, for full type information (replacing `.gql` with `.graphql` depending on what you use):
|
|
85
83
|
|
|
86
84
|
```typescript
|
|
87
85
|
declare module "*.gql" {
|
|
@@ -123,7 +121,7 @@ graphqlLoader({ sourceMapOptions: { hires: true } });
|
|
|
123
121
|
|
|
124
122
|
**_v4.0.0_**:
|
|
125
123
|
|
|
126
|
-
- Added source-map generation. Can
|
|
124
|
+
- Added source-map generation. Can be disabled by initializing with `graphqlLoader({noSourceMap: true})`.
|
|
127
125
|
- Refactored code generation to be more maintainable, added more test cases.
|
|
128
126
|
- Migrated from `yarn` to `bun`.
|
|
129
127
|
|