mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-06 17:15:38 -08:00
GraphQL docs #1074
This commit is contained in:
64
docs/DEBUG_GRAPHQL.md
Executable file
64
docs/DEBUG_GRAPHQL.md
Executable file
@@ -0,0 +1,64 @@
|
||||
# Debugging GraphQL server issues
|
||||
|
||||
The GraphQL server is an API middle layer, running on it's own port specified by `GRAPHQL_PORT`, to retrieve and show the data in the UI. It can also be used to retrieve data for custom third party integarions. Check the [API documentation](./API.md) for details.
|
||||
|
||||
The most common issue is that the GraphQL server doesn't start properly, usually due to a **port conflict**. If you are running multiple NetAlertX instances, make sure to use **unique ports** by changing the `GRAPHQL_PORT` setting. The default is `20212`.
|
||||
|
||||
## How to update the `GRAPHQL_PORT` in case of issues
|
||||
|
||||
As a first troubleshooting step try changing the default `GRAPHQL_PORT` setting. Please remember NetAlertX is running on the host so any application uising the same port will cause issues.
|
||||
|
||||
### Updating the setting via the Settings UI
|
||||
|
||||
Ideally use the Settings UI to update the setting under General -> Core -> GraphQL port:
|
||||
|
||||

|
||||
|
||||
You might need to temporarily stop other applications or NetAlertX instances causing conflicts to update the setting. The `API_TOKEN` is used to authenticate any API calls, including GraphQL requests.
|
||||
|
||||
### Updating the `app.conf` file
|
||||
|
||||
If the UI is not accessible, you can directly edit the `app.conf` file in your `/config` folder:
|
||||
|
||||

|
||||
|
||||
### Using a docker variable
|
||||
|
||||
All application settings can also be initialized via the `APP_CONF_OVERRIDE` docker env variable.
|
||||
|
||||
```yaml
|
||||
...
|
||||
environment:
|
||||
- TZ=Europe/Berlin
|
||||
- PORT=20213
|
||||
- APP_CONF_OVERRIDE={"GRAPHQL_PORT":"20214"}
|
||||
...
|
||||
```
|
||||
|
||||
## How to check the GraphQL server is running?
|
||||
|
||||
There are several ways to check if the GraphQL server is running.
|
||||
|
||||
### Init Check
|
||||
|
||||
You can navigate to Maintenance -> Init Check to see if `isGraphQLServerRunning` is ticked:
|
||||
|
||||

|
||||
|
||||
### Checking the Logs
|
||||
|
||||
You can navigate to Maintenance -> Logs and search for `graphql` to see if it started correctly and serving requests:
|
||||
|
||||

|
||||
|
||||
### Inspecting the Browser console
|
||||
|
||||
In your browser open the dev console (usually F12) and navigate to the Network tab where you can filter GraphQL requests (e.g., reload the Devices page).
|
||||
|
||||

|
||||
|
||||
You can then inspect any of the POST requests by opening them in a new tab.
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -85,8 +85,8 @@ services:
|
||||
# (Optional) Useful for debugging setup issues
|
||||
- local/path/logs:/app/log
|
||||
# (API: OPTION 1) Store temporary files in memory (recommended for performance)
|
||||
- type: tmpfs # ◀
|
||||
target: /app/api # ◀
|
||||
- type: tmpfs # ◀ 🔺
|
||||
target: /app/api # ◀ 🔺
|
||||
# (API: OPTION 2) Store API data on disk (useful for debugging)
|
||||
# - local/path/api:/app/api
|
||||
environment:
|
||||
|
||||
BIN
docs/img/DEBUG_GRAPHQL/Init_check.png
Executable file
BIN
docs/img/DEBUG_GRAPHQL/Init_check.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 135 KiB |
BIN
docs/img/DEBUG_GRAPHQL/app_conf_graphql_port.png
Executable file
BIN
docs/img/DEBUG_GRAPHQL/app_conf_graphql_port.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
docs/img/DEBUG_GRAPHQL/dev_console_graphql_json.png
Executable file
BIN
docs/img/DEBUG_GRAPHQL/dev_console_graphql_json.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
BIN
docs/img/DEBUG_GRAPHQL/graphql_running_logs.png
Executable file
BIN
docs/img/DEBUG_GRAPHQL/graphql_running_logs.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
BIN
docs/img/DEBUG_GRAPHQL/graphql_settings_port_token.png
Executable file
BIN
docs/img/DEBUG_GRAPHQL/graphql_settings_port_token.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
BIN
docs/img/DEBUG_GRAPHQL/network_graphql.png
Executable file
BIN
docs/img/DEBUG_GRAPHQL/network_graphql.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
0
front/php/templates/language/it_it.json
Normal file → Executable file
0
front/php/templates/language/it_it.json
Normal file → Executable file
@@ -61,6 +61,7 @@ nav:
|
||||
- Troubleshooting:
|
||||
- Inspecting Logs: LOGGING.md
|
||||
- Debugging Tips: DEBUG_TIPS.md
|
||||
- Debugging GraphQL: DEBUG_GRAPHQL.md
|
||||
- Debugging Invalid JSON: DEBUG_INVALID_JSON.md
|
||||
- Debugging Plugins: DEBUG_PLUGINS.md
|
||||
- Debugging Web UI Port: WEB_UI_PORT_DEBUG.md
|
||||
|
||||
Reference in New Issue
Block a user