Graphql how to use it

Hi,

I want to look how it works fine vyos

but when I access vyos/graphql i see a client?

possible to limit the access there and where can I pull any?

The documentation is low for graphql :frowning:

There is an example of configuration

set service https api graphql authentication type 'key'
set service https api graphql introspection
set service https api keys id KID key 'foo'
set service https api socket
set service https virtual-host vyos listen-port '443'

Example of query

curl -k --raw 'https://localhost/graphql' -H 'Content-Type: application/json' -d '{"query":" {ShowVrf (data: {key: \"foo\"}) {success errors data {result}}}"}'

Output:

{"data":{"ShowVrf":{"success":true,"errors":null,"data":{"result":[{"ifname":"foo","operstate":"UP","address":"d2:02:39:ee:7e:dd","flags":["NOARP","MASTER","UP","LOWER_UP"]}]}}}}[edit]
2 Likes

thx for your hint :blush: i will try it