Skip to content

Commit 9d68df0

Browse files
committed
chore: release v0.0.3
1 parent 9d45867 commit 9d68df0

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
lines changed

Diff for: .vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"volar.tsPlugin": true
3+
}

Diff for: examples/spa/src/components/TestComponent.vue

+8-10
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,24 @@ const { fetching, error, data } = useQuery<any, any>({ name: throttled })
1313
<template>
1414
<div class="max-w-screen-md px-4 py-8 mx-auto flex flex-col">
1515
<input v-model="name" class="rounded flex py-2 px-4 bg-transparent border-1 border-green-500 text-white" type="text">
16-
<div class="p-8 text-center" v-if="fetching">Loading...</div>
16+
<div v-if="fetching" class="p-8 text-center">
17+
Loading...
18+
</div>
1719
<div v-else-if="error?.message">
1820
{{ error?.message }}
1921
</div>
20-
<div class="py-8" v-else>
22+
<div v-else class="py-8">
2123
<div v-for="artist in data.queryArtists" :key="artist.name">
2224
<div class="flex flex-row">
2325
<img class="rounded max-w-72" :src="artist.image">
24-
<div class="text-5xl ml-4">{{ artist.name }}</div>
26+
<div class="text-5xl ml-4">
27+
{{ artist.name }}
28+
</div>
2529
</div>
2630
<div class="mt-8">
2731
<span class="font-bold text-sm block">Albums</span>
2832
<div class="grid grid-cols-3 gap-4">
29-
<div v-for="album in artist.albums" class="bg-gray-800">
33+
<div v-for="album in artist.albums" :key="album.name" class="bg-gray-800">
3034
<img :src="album.image">
3135
<span class="block text-xs py-4 px-4">{{ album.name }}</span>
3236
</div>
@@ -49,9 +53,3 @@ query($name: String!) {
4953
}
5054
}
5155
</gql>
52-
53-
<gql name="hi">
54-
query {
55-
hi
56-
}
57-
</gql>

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vite-plugin-vue-gql",
33
"description": "Vue SFC GraphQL Block",
4-
"version": "0.0.2",
4+
"version": "0.0.3",
55
"main": "dist/index.js",
66
"module": "dist/index.mjs",
77
"types": "dist/index.d.ts",

Diff for: src/index.ts

+4-7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { parse } from '@vue/compiler-sfc'
44
import { parse as _parse } from '@babel/parser'
55
import { parseVueRequest } from './query'
66
import { collectNodes, collectUseImports, mergeNodesWithQueries, replaceAtIndexs } from './util'
7+
// import { UserOptions } from './types'
78

89
const ID = 'vite-gql'
910

@@ -18,20 +19,16 @@ function vqlPlugin(): Plugin {
1819
return ID
1920
},
2021
async load(id) {
21-
if (id === ID) {
22-
return `
23-
export { useQuery, useMutation, useSubscription } from '@urql/vue'
24-
`
25-
}
22+
if (id === ID)
23+
return 'export { useQuery, useMutation, useSubscription } from \'@urql/vue\''
2624
},
2725
async transform(code: string, id: string) {
2826
const fileRegex = /\.(vue)$/
2927
const { query } = parseVueRequest(id)
3028

3129
if (query && query.vue && query.type === 'gql') {
3230
return {
33-
code: `
34-
export default {}`,
31+
code: 'export default {}',
3532
map: null,
3633
}
3734
}

Diff for: src/types.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export interface Options {
2+
3+
}
4+
5+
export type UserOptions = Partial<Options>

0 commit comments

Comments
 (0)