Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alansikora/vite-plugin-simple-gql
https://github.com/alansikora/vite-plugin-simple-gql
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/alansikora/vite-plugin-simple-gql
- Owner: alansikora
- Created: 2021-11-24T21:33:17.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-24T21:58:31.000Z (almost 3 years ago)
- Last Synced: 2024-10-11T07:30:58.937Z (about 1 month ago)
- Language: TypeScript
- Size: 1.95 KB
- Stars: 26
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ⚡ vite-plugin-simple-gql
[![npm](https://img.shields.io/npm/v/vite-plugin-simple-gql.svg)](https://www.npmjs.com/package/vite-plugin-simple-gql)
[![npm](https://img.shields.io/npm/dt/vite-plugin-simple-gql)](https://www.npmjs.com/package/vite-plugin-simple-gql)Easily import [`.graphql`] and [`.gql`] files using [`Vite`].
[`vite`]: https://github.com/vitejs/vite
## Install
```bash
npm i vite-plugin-simple-gql -D
# yarn add vite-plugin-simple-gql -D
```## Usage
add this plugin to `vite.config.js`
```js
import { defineConfig } from 'vite';
import gql from 'vite-plugin-simple-gql';
export default defineConfig({
plugins: [gql()]
});
```import your `graphql` files
```js
import MyQuery from './queries/MyQuery.graphql'
```##
## License
MIT