@@ -51,10 +51,10 @@ from TanStack Query.
51
51
[ use-query ] : https://tanstack.com/query/v5/docs/framework/react/reference/useQuery
52
52
53
53
``` tsx
54
- import { useCodeSamplesGet } from " @speakeasyapi/code-samples/react-query/codeSamplesGet.js" ;
54
+ import { useCodeSamples } from " @speakeasyapi/code-samples/react-query/codeSamplesGet.js" ;
55
55
56
56
export function Example() {
57
- const { data, error, status } = useCodeSamplesGet ({
57
+ const { data, error, status } = useCodeSamples ({
58
58
registryUrl: " https://spec.speakeasy.com/my-org/my-workspace/my-source" ,
59
59
operationIds: [
60
60
" getPets" ,
@@ -82,11 +82,11 @@ more options provided by the query hooks to control these behaviors.
82
82
83
83
``` tsx
84
84
import { useState } from " react" ;
85
- import { useCodeSamplesGet } from " @speakeasyapi/code-samples/react-query/codeSamplesGet.js" ;
85
+ import { useCodeSamples } from " @speakeasyapi/code-samples/react-query/codeSamplesGet.js" ;
86
86
87
87
export function ExampleWithOptions() {
88
88
const [enabled, setEnabled] = useState (true );
89
- const { data, error, status } = useCodeSamplesGet (
89
+ const { data, error, status } = useCodeSamples (
90
90
{
91
91
registryUrl: " https://spec.speakeasy.com/my-org/my-workspace/my-source" ,
92
92
operationIds: [
@@ -137,7 +137,7 @@ query hook there are two functions that help invalidate cached data:
137
137
138
138
``` tsx
139
139
import { useQueryClient } from " @tanstack/react-query" ;
140
- import { invalidateCodeSamplesGet , invalidateAllCodeSamplesGet } from " @speakeasyapi/code-samples/react-query/codeSamplesGet.js" ;
140
+ import { invalidateCodeSamples , invalidateAllCodeSamples } from " @speakeasyapi/code-samples/react-query/codeSamplesGet.js" ;
141
141
// Replace this with a real mutation
142
142
import { useExampleMutation } from " @speakeasyapi/code-samples/react-query/example.js" ;
143
143
@@ -155,9 +155,9 @@ export function Example() {
155
155
mutate (formData , {
156
156
onSuccess : () => {
157
157
// Invalidate a single cache entry:
158
- invalidateCodeSamplesGet (queryClient , /* ... arguments ... */ );
158
+ invalidateCodeSamples (queryClient , /* ... arguments ... */ );
159
159
// OR, invalidate all cache entries for the query targets:
160
- invalidateAllCodeSamplesGet (queryClient );
160
+ invalidateAllCodeSamples (queryClient );
161
161
},
162
162
});
163
163
}}
@@ -185,7 +185,7 @@ import { ErrorBoundary } from "react-error-boundary";
185
185
186
186
import { SpeakeasyCodeSamplesCore } from " @speakeasyapi/code-samples" ;
187
187
import { SpeakeasyCodeSamplesProvider } from " @speakeasyapi/code-samples/react-query" ;
188
- import { useCodeSamplesGetSuspense } from " @speakeasyapi/code-samples/react-query/codeSamplesGet.js" ;
188
+ import { useCodeSamplesSuspense } from " @speakeasyapi/code-samples/react-query/codeSamplesGet.js" ;
189
189
190
190
const queryClient = new QueryClient ();
191
191
const speakeasyCodeSamples = new SpeakeasyCodeSamplesCore ({
@@ -221,7 +221,7 @@ export function App() {
221
221
}
222
222
223
223
function Example() {
224
- const { data } = useCodeSamplesGetSuspense ({
224
+ const { data } = useCodeSamplesSuspense ({
225
225
registryUrl: " https://spec.speakeasy.com/my-org/my-workspace/my-source" ,
226
226
operationIds: [
227
227
" getPets" ,
@@ -256,7 +256,7 @@ import {
256
256
QueryClient ,
257
257
} from " @tanstack/react-query" ;
258
258
import { SpeakeasyCodeSamplesCore } from " @speakeasyapi/code-samples" ;
259
- import { prefetchCodeSamplesGet } from " @speakeasyapi/code-samples/react-query/codeSamplesGet.js" ;
259
+ import { prefetchCodeSamples } from " @speakeasyapi/code-samples/react-query/codeSamplesGet.js" ;
260
260
261
261
export default async function Page() {
262
262
const queryClient = new QueryClient ();
@@ -265,7 +265,7 @@ export default async function Page() {
265
265
registryUrl: " https://spec.speakeasy.com/org/ws/my-source" ,
266
266
});
267
267
268
- await prefetchCodeSamplesGet (queryClient , speakeasyCodeSamples , {
268
+ await prefetchCodeSamples (queryClient , speakeasyCodeSamples , {
269
269
registryUrl: " https://spec.speakeasy.com/my-org/my-workspace/my-source" ,
270
270
operationIds: [
271
271
" getPets" ,
0 commit comments