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.
Files changed (2) hide show
  1. package/README.md +11 -13
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,13 +1,11 @@
1
1
  # vite-plugin-graphql-loader
2
2
 
3
- ![License](https://img.shields.io/github/license/0x31/vite-plugin-graphql-loader?style=for-the-badge&labelColor=2e3440&color=6f4fbe)
4
- ![Version](https://img.shields.io/npm/v/vite-plugin-graphql-loader.svg?label=Version&style=for-the-badge&labelColor=2e3440&color=eea837)
5
- ![Downloads](https://img.shields.io/npm/dw/vite-plugin-graphql-loader?style=for-the-badge&labelColor=2e3440&color=50b6a9)
6
- ![Vite Badge](https://img.shields.io/badge/Vite-646CFF?logo=vite&logoColor=fff&style=for-the-badge)
7
- ![GraphQL Badge](https://img.shields.io/badge/GraphQL-E10098?logo=graphql&logoColor=fff&style=for-the-badge&color=ee4367)
8
- ![TypeScript Badge](https://img.shields.io/badge/TypeScript-3178C6?logo=typescript&logoColor=fff&style=for-the-badge)
9
-
10
- <!-- ![Vitest Badge](https://img.shields.io/badge/Vitest-6E9F18?logo=vitest&logoColor=fff&style=for-the-badge&color=10ad6a) -->
3
+ [![License](https://img.shields.io/github/license/0x31/vite-plugin-graphql-loader?style=for-the-badge&labelColor=2e3440&color=6f4fbe)](https://github.com/0x31/vite-plugin-graphql-loader/blob/master/LICENSE.txt)
4
+ [![Version](https://img.shields.io/npm/v/vite-plugin-graphql-loader.svg?label=Version&style=for-the-badge&labelColor=2e3440&color=eea837)](https://www.npmjs.com/package/vite-plugin-graphql-loader)
5
+ [![Downloads](https://img.shields.io/npm/dw/vite-plugin-graphql-loader?style=for-the-badge&labelColor=2e3440&color=50b6a9)](https://www.npmjs.com/package/vite-plugin-graphql-loader)
6
+ [![Vite Badge](https://img.shields.io/badge/Vite-646CFF?logo=vite&logoColor=fff&style=for-the-badge)](https://vite.dev)
7
+ [![GraphQL Badge](https://img.shields.io/badge/GraphQL-E10098?logo=graphql&logoColor=fff&style=for-the-badge&color=ee4367)](https://graphql.org)
8
+ [![TypeScript Badge](https://img.shields.io/badge/TypeScript-3178C6?logo=typescript&logoColor=fff&style=for-the-badge)](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 --save-dev
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 and
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_**, change it to this (replacing .gql with .graphql depending on what you use):
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 by disabled by initializing with `graphqlLoader({noSourceMap: true})`.
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-graphql-loader",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "A Vite plugin for loading GraphQL files.",
5
5
  "keywords": [
6
6
  "graphql",