Skip to content

Commit f66be91

Browse files
authored
fix docs typos (#1836)
* fix docs typos * revert quotes switch * remove lint line
1 parent 5f3f78e commit f66be91

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

packages/openapi-react-query/README.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ It works by using [openapi-fetch](../openapi-fetch) and [openapi-typescript](../
88
- ✅ All parameters, request bodies, and responses are type-checked and 100% match your schema
99
- ✅ No manual typing of your API
1010
- ✅ Eliminates `any` types that hide bugs
11-
-Also eliminates `as` type overrides that can also hide bugs
11+
-Eliminates `as` type overrides that can also hide bugs
1212

1313
## Setup
1414

@@ -25,11 +25,9 @@ Next, generate TypeScript types from your OpenAPI schema using openapi-typescrip
2525
npx openapi-typescript ./path/to/api/v1.yaml -o ./src/lib/api/v1.d.ts
2626
```
2727

28-
> ⚠️ Be sure to <a href="https://redocly.com/docs/cli/commands/lint/" target="_blank" rel="noopener noreferrer">validate your schemas</a>! openapi-typescript will err on invalid schemas.
29-
3028
## Usage
3129

32-
Once your types has been generated from your schema, you can create a [fetch client](../openapi-fetch), a react-query client and start querying your API.
30+
Once your types have been generated from your schema, you can create a [fetch client](../openapi-fetch), a react-query client and start querying your API.
3331

3432
```tsx
3533
import createFetchClient from "openapi-fetch";
@@ -42,25 +40,25 @@ const fetchClient = createFetchClient<paths>({
4240
const $api = createClient(fetchClient);
4341

4442
const MyComponent = () => {
45-
const { data, error, isLoading } = $api.useQuery(
43+
const { data, error, isPending } = $api.useQuery(
4644
"get",
4745
"/blogposts/{post_id}",
4846
{
4947
params: {
5048
path: { post_id: 5 },
5149
},
52-
},
50+
}
5351
);
5452

55-
if (isLoading || !data) return "Loading...";
53+
if (isPending || !data) return "Loading...";
5654

57-
if (error) return `An error occured: ${error.message}`;
55+
if (error) return `An error occurred: ${error.message}`;
5856

5957
return <div>{data.title}</div>;
6058
};
6159
```
6260

63-
> You can find more information about `createFetchClient` on the [openapi-fetch documentation](../openapi-fetch).
61+
> You can find more information about `createFetchClient` in the [openapi-fetch documentation](../openapi-fetch).
6462
6563
## 📓 Docs
6664

0 commit comments

Comments
 (0)