Skip to content

Commit 13ed51c

Browse files
docs: improve api connection docs
1 parent fc1e32b commit 13ed51c

1 file changed

Lines changed: 20 additions & 10 deletions

File tree

docs/docs/data-management/API-CONNECTION.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,38 @@
11
---
2-
id: backend-connection
3-
slug: /backend-connection
4-
title: Backend connection
5-
sidebar_position: 4
2+
id: api-connection
3+
slug: /api-connection
4+
title: API connection
5+
sidebar_position: 1
66
tags:
77
- Backend
8+
- API
89
- react-query
910
- axios
1011
- react native
1112
- orval
12-
description: Backend connection - check how to fetch data from backend and display it for users
13+
description: API connection - check how to fetch data from backend and display it for users
1314
---
1415

15-
# Backend connection
16+
# API connection
1617

17-
This template uses this packages to keep connection with backend:
18+
This template uses this packages to keep connection with API:
1819

19-
- [axios](https://axios-http.com/docs/intro) - direct calls to backend
20+
- [axios](https://axios-http.com/docs/intro) - direct calls to API
2021
- [react-query](https://tanstack.com/query/latest/docs/framework/react/overview) - use hooks that helps displaying data on UI
21-
- [orval](https://orval.dev/overview) - generating query hooks based on swagger (provided by backend)
22+
- [orval](https://orval.dev/overview) - generating query hooks based on swagger (provided by backend developers)
23+
24+
:::note
25+
If you are not using swagger (or open API v3) on your backend side it could be hard for you to make this working, because we are using [orval](https://orval.dev/overview) to auto generate everything.
26+
27+
If you will have any issues please contact **[Mateusz Rostkowski](https://www.github.com/MateuszRostkowski)**
28+
:::
2229

2330
## Generate new query
2431

25-
1. Get `swagger-spec.json` - example: https://gist.github.com/lenage/08964335de9064540c8c335fb849c5da
32+
All api connection code is automatically generated based on swagger schema, you will just need to do this few steps to update your code base.
33+
34+
1. Get `swagger-spec.json` from backend - example: https://gist.github.com/lenage/08964335de9064540c8c335fb849c5da
35+
- This also could be automaticaly done, probably we will work on it soon :)
2636
2. Replace it in `./scripts/data` folder
2737
3. Run script `yarn generate:query`
2838
4. See the magic happens ✨

0 commit comments

Comments
 (0)