You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple way to use your GraphQL operations in a type-safe way with Vue!
4
+
It uses [graphql-code-generator](https://github.com/dotansimha/graphql-code-generator) to generate the types everything.
5
+
6
+
### Quick start
7
+
As this package is dependent on [graphql-code-generator](https://github.com/dotansimha/graphql-code-generator) you may first install it and create a config for it.
8
+
[Here](https://github.com/dotansimha/graphql-code-generator#quick-start) is a guide on how to do that.
9
+
10
+
As soo as you're ready you can continue to setup this package.
11
+
First of all you need to [install it](#setup) with your preferred package manager.
12
+
13
+
The *graphql-code-generator* plugin can be found under `vue-graphql-inject/lib/codegen`.
14
+
You may add a new output file specifically for this plugin. For example:
15
+
```yaml
16
+
schema: "http://localhost:3000/graphql"
17
+
documents: "**/*.graphql"
18
+
generates:
19
+
src/generated/graphql-inject.ts:
20
+
- "vue-graphql-inject/lib/codegen"
21
+
```
22
+
23
+
The next step is to add the `Vue` plugin:
24
+
```javascript
25
+
import Vue from 'vue'
26
+
import { VueGraphQLInject } from 'vue-graphql-inject/lib/vue'
27
+
import { GraphQLInjectDefinition } from './generated/graphql-inject.ts'
0 commit comments