@falcondev-oss/trpc-vue-query 0.5.0-rc.7 → 0.5.0-rc.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -58,12 +58,16 @@ function createVueQueryProxyDecoration(name, trpc, queryClient) {
58
58
  if (prop === "query") {
59
59
  return trpc.query(joinedPath, firstArg, opts);
60
60
  }
61
- function createQuery(input, { trpcOptions, queryOptions }) {
61
+ function createQuery(_input, { trpcOptions, queryOptions }) {
62
+ const input = (0, import_core.toValue)(_input);
62
63
  return (0, import_vue_query.queryOptions)({
63
- queryKey: (0, import_vue.computed)(() => getQueryKey(path, (0, import_core.toValue)(input), "query")),
64
- queryFn: async ({ queryKey, signal }) => trpc.query(joinedPath, queryKey[1]?.input, {
65
- signal,
66
- ...trpcOptions
64
+ queryKey: (0, import_vue.computed)(() => getQueryKey(path, input, "query")),
65
+ queryFn: async ({ signal }) => ({
66
+ output: await trpc.query(joinedPath, input, {
67
+ signal,
68
+ ...trpcOptions
69
+ }),
70
+ input
67
71
  }),
68
72
  ...maybeToRefs(queryOptions)
69
73
  });
package/dist/index.mjs CHANGED
@@ -43,12 +43,16 @@ function createVueQueryProxyDecoration(name, trpc, queryClient) {
43
43
  if (prop === "query") {
44
44
  return trpc.query(joinedPath, firstArg, opts);
45
45
  }
46
- function createQuery(input, { trpcOptions, queryOptions }) {
46
+ function createQuery(_input, { trpcOptions, queryOptions }) {
47
+ const input = toValue(_input);
47
48
  return defineQueryOptions({
48
- queryKey: computed(() => getQueryKey(path, toValue(input), "query")),
49
- queryFn: async ({ queryKey, signal }) => trpc.query(joinedPath, queryKey[1]?.input, {
50
- signal,
51
- ...trpcOptions
49
+ queryKey: computed(() => getQueryKey(path, input, "query")),
50
+ queryFn: async ({ signal }) => ({
51
+ output: await trpc.query(joinedPath, input, {
52
+ signal,
53
+ ...trpcOptions
54
+ }),
55
+ input
52
56
  }),
53
57
  ...maybeToRefs(queryOptions)
54
58
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@falcondev-oss/trpc-vue-query",
3
3
  "type": "module",
4
- "version": "0.5.0-rc.7",
4
+ "version": "0.5.0-rc.9",
5
5
  "description": "A tRPC wrapper around '@tanstack/vue-query'",
6
6
  "license": "MIT",
7
7
  "repository": "github:falcondev-oss/trpc-vue-query",
@@ -27,8 +27,8 @@
27
27
  },
28
28
  "peerDependencies": {
29
29
  "@tanstack/vue-query": "^5.22.2",
30
- "@trpc/client": "11",
31
- "@trpc/server": "11",
30
+ "@trpc/client": "next",
31
+ "@trpc/server": "next",
32
32
  "vue": "^3.4.19"
33
33
  },
34
34
  "dependencies": {