GraphQL documentation #933
-
Is there a documentation for the reasonably new graphql backend and how to query it? Example: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey @ingoratsdorf, I didn't think to write up one, but can do in future. Check out the schema definition, you are probably after the https://github.com/jokob-sk/NetAlertX/blob/main/server/graphql_server/graphql_schema.py You can probably feed in the schema into chatgpt and ask for examples. Hope this helps, |
Beta Was this translation helpful? Give feedback.
-
Never been a big friend of GitHUB CoPilot, but:
result: Certainly! Here is an example of how you can perform a GraphQL query using Example Query to Fetch DevicesFirst, let's define the GraphQL query to fetch devices with pagination and sorting options. query GetDevices($options: PageQueryOptionsInput) {
devices(options: $options) {
devices {
rowid
devMac
devName
devOwner
devType
devVendor
devLastConnection
devStatus
}
count
}
}
|
Beta Was this translation helpful? Give feedback.
Never been a big friend of GitHUB CoPilot, but:
Can you show an example for a query using the graphql schema in https://github.com/jokob-sk/NetAlertX/blob/main/server/graphql_server/graphql_schema.py
result:
Certainly! Here is an example of how you can perform a GraphQL query using
curl
to fetch device data from the GraphQL schema defined inserver/graphql_server/graphql_schema.py
.Example Query to Fetch Devices
First, let's define the GraphQL query to fetch devices with pagination and sorting options.