Skip to content

Commit 7c6fb02

Browse files
committed
fix docs
1 parent 2e3d7ab commit 7c6fb02

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/rtk-query/usage/code-generation.mdx

+8-8
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ We provide a package for RTK Query code generation from OpenAPI schemas. It is p
2828

2929
Create an empty api using `createApi` like
3030

31-
```ts
31+
```ts no-transpile
3232
// Or from '@reduxjs/toolkit/query' if not using the auto-generated hooks
3333
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'
3434

@@ -41,8 +41,8 @@ export const emptySplitApi = createApi({
4141

4242
Generate a config file (json, js or ts) with contents like
4343

44-
```ts
45-
import { ConfigFile } from '@rtk-incubator/rtk-query-codegen-openapi'
44+
```ts no-transpile
45+
import { ConfigFile } from '@rtk-query/codegen-openapi'
4646

4747
const config: ConfigFile = {
4848
schemaFile: 'https://petstore3.swagger.io/api/v3/openapi.json',
@@ -64,7 +64,7 @@ npx @rtk-query/codegen-openapi openapi-config.ts
6464

6565
### Programmatic usage
6666

67-
```ts
67+
```ts no-transpile
6868
import { generateEndpoints } from '@rtk-query/codegen-openapi'
6969

7070
const api = await generateEndpoints({
@@ -79,7 +79,7 @@ const api = await generateEndpoints({
7979

8080
#### Simple usage
8181

82-
```ts
82+
```ts no-transpile
8383
interface SimpleUsage {
8484
apiFile: string
8585
schemaFile: string
@@ -107,7 +107,7 @@ export type EndpointMatcherFunction = (
107107
108108
If you only want to include a few endpoints, you can use the `filterEndpoints` config option to filter your endpoints.
109109
110-
```ts
110+
```ts no-transpile
111111
const filteredConfig: ConfigFile = {
112112
// ...
113113
// should only have endpoints loginUser, placeOrder, getOrderById, deleteOrder
@@ -119,7 +119,7 @@ const filteredConfig: ConfigFile = {
119119

120120
If an endpoint is generated as a mutation instead of a query or the other way round, you can override that:
121121

122-
```ts
122+
```ts no-transpile
123123
const withOverride: ConfigFile = {
124124
// ...
125125
endpointOverrides: [
@@ -133,7 +133,7 @@ const withOverride: ConfigFile = {
133133

134134
#### Multiple output files
135135

136-
```ts
136+
```ts no-transpile
137137
const config: ConfigFile = {
138138
schemaFile: 'https://petstore3.swagger.io/api/v3/openapi.json',
139139
apiFile: './src/store/emptyApi.ts',

0 commit comments

Comments
 (0)