@trpc/react-query 11.0.0-next-alpha.166 → 11.0.0-next-alpha.168

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.
@@ -1,10 +1,13 @@
1
- import type { AnyProcedure, AnyRootConfig, inferProcedureInput, inferTransformedProcedureOutput } from '@trpc/core';
1
+ import type { TRPCClientErrorLike } from '@trpc/client';
2
+ import type { AnyProcedure, AnyRootConfig, inferProcedureInput, inferProcedureOutput, inferTransformedProcedureOutput } from '@trpc/core';
2
3
  import type { InferQueryOptions, InferQueryResult } from '../../utils/inferReactQueryProcedure';
4
+ import type { UseTRPCSuspenseQueryResult } from '../hooks/types';
3
5
  /**
4
6
  * Use to request a query route which matches a given query procedure's interface
5
7
  */
6
8
  export type QueryLike<TConfig extends AnyRootConfig, TProcedure extends AnyProcedure> = {
7
9
  useQuery: (variables: inferProcedureInput<TProcedure>, opts?: InferQueryOptions<TConfig, TProcedure, any>) => InferQueryResult<TConfig, TProcedure>;
10
+ useSuspenseQuery: (variables: inferProcedureInput<TProcedure>, opts?: InferQueryOptions<TConfig, TProcedure, any>) => UseTRPCSuspenseQueryResult<inferProcedureOutput<TProcedure>, TRPCClientErrorLike<TConfig>>;
8
11
  };
9
12
  /**
10
13
  * Use to unwrap a QueryLike's input
@@ -1 +1 @@
1
- {"version":3,"file":"queryLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/queryLike.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,+BAA+B,EAChC,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,SAAS,CACnB,OAAO,SAAS,aAAa,EAC7B,UAAU,SAAS,YAAY,IAC7B;IACF,QAAQ,EAAE,CACR,SAAS,EAAE,mBAAmB,CAAC,UAAU,CAAC,EA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;IAE3C,gBAAgB,EAAE,CAChB,SAAS,EAAE,mBAAmB,CAAC,UAAU,CAAC,EAC1C,IAAI,CAAC,EAAE,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,CAAC,KAC/C,0BAA0B,CAC7B,oBAAoB,CAAC,UAAU,CAAC,EAChC,mBAAmB,CAAC,OAAO,CAAC,CAC7B,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,UAAU,SAAS,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,IACpE,UAAU,SAAS,SAAS,CAAC,GAAG,EAAE,MAAM,UAAU,CAAC,GAC/C,mBAAmB,CAAC,UAAU,CAAC,GAC/B,KAAK,CAAC;AAEZ;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,UAAU,SAAS,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,IACnE,UAAU,SAAS,SAAS,CAAC,MAAM,OAAO,EAAE,MAAM,UAAU,CAAC,GACzD,+BAA+B,CAAC,OAAO,EAAE,UAAU,CAAC,GACpD,KAAK,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/react-query",
3
- "version": "11.0.0-next-alpha.166+5ecfbf985",
3
+ "version": "11.0.0-next-alpha.168+578e61d32",
4
4
  "description": "The tRPC React library",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -57,17 +57,17 @@
57
57
  }
58
58
  },
59
59
  "dependencies": {
60
- "@trpc/core": "11.0.0-next-alpha.166+5ecfbf985"
60
+ "@trpc/core": "11.0.0-next-alpha.168+578e61d32"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "@tanstack/react-query": "^5.0.0",
64
- "@trpc/client": "11.0.0-next-alpha.166+5ecfbf985",
64
+ "@trpc/client": "11.0.0-next-alpha.168+578e61d32",
65
65
  "react": ">=18.2.0",
66
66
  "react-dom": ">=18.2.0"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@tanstack/react-query": "^5.0.0",
70
- "@trpc/client": "11.0.0-next-alpha.166+5ecfbf985",
70
+ "@trpc/client": "11.0.0-next-alpha.168+578e61d32",
71
71
  "@types/express": "^4.17.17",
72
72
  "@types/node": "^20.10.0",
73
73
  "@types/react": "^18.2.33",
@@ -86,5 +86,5 @@
86
86
  "funding": [
87
87
  "https://trpc.io/sponsor"
88
88
  ],
89
- "gitHead": "5ecfbf98572f30205bdf18aa7550443d4cf0f7ec"
89
+ "gitHead": "578e61d320f67cc9a563353a846ca7604a50194b"
90
90
  }
@@ -1,13 +1,16 @@
1
+ import type { TRPCClientErrorLike } from '@trpc/client';
1
2
  import type {
2
3
  AnyProcedure,
3
4
  AnyRootConfig,
4
5
  inferProcedureInput,
6
+ inferProcedureOutput,
5
7
  inferTransformedProcedureOutput,
6
8
  } from '@trpc/core';
7
9
  import type {
8
10
  InferQueryOptions,
9
11
  InferQueryResult,
10
12
  } from '../../utils/inferReactQueryProcedure';
13
+ import type { UseTRPCSuspenseQueryResult } from '../hooks/types';
11
14
 
12
15
  /**
13
16
  * Use to request a query route which matches a given query procedure's interface
@@ -20,6 +23,14 @@ export type QueryLike<
20
23
  variables: inferProcedureInput<TProcedure>,
21
24
  opts?: InferQueryOptions<TConfig, TProcedure, any>,
22
25
  ) => InferQueryResult<TConfig, TProcedure>;
26
+
27
+ useSuspenseQuery: (
28
+ variables: inferProcedureInput<TProcedure>,
29
+ opts?: InferQueryOptions<TConfig, TProcedure, any>,
30
+ ) => UseTRPCSuspenseQueryResult<
31
+ inferProcedureOutput<TProcedure>,
32
+ TRPCClientErrorLike<TConfig>
33
+ >;
23
34
  };
24
35
 
25
36
  /**