Skip to content

Commit 742d003

Browse files
committed
fix(vue): Adjust definition interface
1 parent 34c5b09 commit 742d003

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/vue/index.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import _Vue from 'vue'
22
import {DocumentNode} from "graphql";
33

4+
interface DefinitionInterface {
5+
queries: { [key: string]: DocumentNode };
6+
mutations: { [key: string]: DocumentNode };
7+
subscriptions: { [key: string]: DocumentNode };
8+
}
9+
410
export interface VueGraphQLInjectOptions {
511
definition: { [key: string]: DocumentNode };
612
}
713

8-
export function VueGraphQLInject(Vue: typeof _Vue, options: VueGraphQLInjectOptions): void{
9-
Vue.prototype.$gql = (): { operations: { [key: string]: DocumentNode } } => ({
10-
operations: options.definition
11-
})
14+
export function VueGraphQLInject(Vue: typeof _Vue, options: VueGraphQLInjectOptions): void {
15+
Vue.prototype.$gql = options.definition
1216
}

0 commit comments

Comments
 (0)