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: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/alansikora/vite-plugin-simple-gql
- Owner: alansikora
- Created: 2021-11-24T21:33:17.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-24T21:58:31.000Z (about 3 years ago)
- Last Synced: 2024-10-11T07:30:58.937Z (4 months 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
[](https://www.npmjs.com/package/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