Skip to content

Commit d60be67

Browse files
shuconAutomatedTester
authored andcommitted
Add GraphQL support documentation
1 parent 79ee5e3 commit d60be67

8 files changed

+610
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: "GraphQL querying support"
3+
weight: 1
4+
---
5+
6+
{{% notice info %}}
7+
<i class="fas fa-language"></i> Diese Seite wird von Englisch
8+
auf Deutsch übersetzt. Sprichst Du Deutsch? Hilf uns die Seite
9+
zu übersetzen indem Du uns einen Pull Reqeust schickst!
10+
{{% /notice %}}
11+
12+
GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. It gives users the power to ask for exactly what they need and nothing more.
13+
14+
## Enums
15+
Enums represent possible sets of values for a field.
16+
17+
For example, the `Node` object has a field called `status`. The state is an enum (specifically, of type `Status`) because it may be `UP` , `DRAINING` or `UNAVAILABLE`.
18+
19+
## Scalars
20+
Scalars are primitive values: `Int`, `Float`, `String`, `Boolean`, or `ID`.
21+
22+
When calling the GraphQL API, you must specify nested subfield until you return only scalars.
23+
24+
25+
## Structure of the Schema
26+
The structure of grid schema is as follows:
27+
28+
```shell
29+
{
30+
grid: {
31+
uri,
32+
totalSlots,
33+
usedSlots,
34+
nodes : [
35+
{
36+
id,
37+
uri,
38+
status,
39+
maxSession,
40+
capabilities
41+
}
42+
]
43+
}
44+
}
45+
```
46+
47+
## Querying GraphQL
48+
49+
The best way to query GraphQL is by using `curl` requests. GraphQL allows you to fetch only the data that you want, nothing more nothing less.
50+
51+
Some of the example GraphQL queries are given below. You can build your own queries as you like.
52+
53+
### Querying the number of `totalSlots` and `usedSlots` in the grid :
54+
55+
```shell
56+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { totalSlots, usedSlots } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
57+
```
58+
59+
Generally on local machine the `<LINK_TO_GRAPHQL_ENDPOINT>` would be `http://localhost:4444/graphql`
60+
61+
### Querying the capabilities of each node in the grid :
62+
63+
```shell
64+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { nodes { capabilities } } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
65+
```
66+
67+
### Querying the status of each node in the grid :
68+
69+
```shell
70+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { nodes { status } } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
71+
```
72+
73+
### Querying the URI of each node and the grid :
74+
75+
```shell
76+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { nodes { uri }, uri } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
77+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: "GraphQL querying support"
3+
weight: 1
4+
---
5+
6+
GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. It gives users the power to ask for exactly what they need and nothing more.
7+
8+
## Enums
9+
Enums represent possible sets of values for a field.
10+
11+
For example, the `Node` object has a field called `status`. The state is an enum (specifically, of type `Status`) because it may be `UP` , `DRAINING` or `UNAVAILABLE`.
12+
13+
## Scalars
14+
Scalars are primitive values: `Int`, `Float`, `String`, `Boolean`, or `ID`.
15+
16+
When calling the GraphQL API, you must specify nested subfield until you return only scalars.
17+
18+
19+
## Structure of the Schema
20+
The structure of grid schema is as follows:
21+
22+
```shell
23+
{
24+
grid: {
25+
uri,
26+
totalSlots,
27+
usedSlots,
28+
nodes : [
29+
{
30+
id,
31+
uri,
32+
status,
33+
maxSession,
34+
capabilities
35+
}
36+
]
37+
}
38+
}
39+
```
40+
41+
## Querying GraphQL
42+
43+
The best way to query GraphQL is by using `curl` requests. GraphQL allows you to fetch only the data that you want, nothing more nothing less.
44+
45+
Some of the example GraphQL queries are given below. You can build your own queries as you like.
46+
47+
### Querying the number of `totalSlots` and `usedSlots` in the grid :
48+
49+
```shell
50+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { totalSlots, usedSlots } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
51+
```
52+
53+
Generally on local machine the `<LINK_TO_GRAPHQL_ENDPOINT>` would be `http://localhost:4444/graphql`
54+
55+
### Querying the capabilities of each node in the grid :
56+
57+
```shell
58+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { nodes { capabilities } } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
59+
```
60+
61+
### Querying the status of each node in the grid :
62+
63+
```shell
64+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { nodes { status } } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
65+
```
66+
67+
### Querying the URI of each node and the grid :
68+
69+
```shell
70+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { nodes { uri }, uri } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
71+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: "GraphQL querying support"
3+
weight: 1
4+
---
5+
6+
{{% notice info %}}
7+
<i class="fas fa-language"></i> Page being translated from
8+
English to Spanish. Do you speak Spanish? Help us to translate
9+
it by sending us pull requests!
10+
{{% /notice %}}
11+
12+
GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. It gives users the power to ask for exactly what they need and nothing more.
13+
14+
## Enums
15+
Enums represent possible sets of values for a field.
16+
17+
For example, the `Node` object has a field called `status`. The state is an enum (specifically, of type `Status`) because it may be `UP` , `DRAINING` or `UNAVAILABLE`.
18+
19+
## Scalars
20+
Scalars are primitive values: `Int`, `Float`, `String`, `Boolean`, or `ID`.
21+
22+
When calling the GraphQL API, you must specify nested subfield until you return only scalars.
23+
24+
25+
## Structure of the Schema
26+
The structure of grid schema is as follows:
27+
28+
```shell
29+
{
30+
grid: {
31+
uri,
32+
totalSlots,
33+
usedSlots,
34+
nodes : [
35+
{
36+
id,
37+
uri,
38+
status,
39+
maxSession,
40+
capabilities
41+
}
42+
]
43+
}
44+
}
45+
```
46+
47+
## Querying GraphQL
48+
49+
The best way to query GraphQL is by using `curl` requests. GraphQL allows you to fetch only the data that you want, nothing more nothing less.
50+
51+
Some of the example GraphQL queries are given below. You can build your own queries as you like.
52+
53+
### Querying the number of `totalSlots` and `usedSlots` in the grid :
54+
55+
```shell
56+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { totalSlots, usedSlots } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
57+
```
58+
59+
Generally on local machine the `<LINK_TO_GRAPHQL_ENDPOINT>` would be `http://localhost:4444/graphql`
60+
61+
### Querying the capabilities of each node in the grid :
62+
63+
```shell
64+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { nodes { capabilities } } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
65+
```
66+
67+
### Querying the status of each node in the grid :
68+
69+
```shell
70+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { nodes { status } } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
71+
```
72+
73+
### Querying the URI of each node and the grid :
74+
75+
```shell
76+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { nodes { uri }, uri } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
77+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: "GraphQL querying support"
3+
weight: 1
4+
---
5+
6+
{{% notice info %}}
7+
<i class="fas fa-language"></i> Page being translated from
8+
English to French. Do you speak French? Help us to translate
9+
it by sending us pull requests!
10+
{{% /notice %}}
11+
12+
GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. It gives users the power to ask for exactly what they need and nothing more.
13+
14+
## Enums
15+
Enums represent possible sets of values for a field.
16+
17+
For example, the `Node` object has a field called `status`. The state is an enum (specifically, of type `Status`) because it may be `UP` , `DRAINING` or `UNAVAILABLE`.
18+
19+
## Scalars
20+
Scalars are primitive values: `Int`, `Float`, `String`, `Boolean`, or `ID`.
21+
22+
When calling the GraphQL API, you must specify nested subfield until you return only scalars.
23+
24+
25+
## Structure of the Schema
26+
The structure of grid schema is as follows:
27+
28+
```shell
29+
{
30+
grid: {
31+
uri,
32+
totalSlots,
33+
usedSlots,
34+
nodes : [
35+
{
36+
id,
37+
uri,
38+
status,
39+
maxSession,
40+
capabilities
41+
}
42+
]
43+
}
44+
}
45+
```
46+
47+
## Querying GraphQL
48+
49+
The best way to query GraphQL is by using `curl` requests. GraphQL allows you to fetch only the data that you want, nothing more nothing less.
50+
51+
Some of the example GraphQL queries are given below. You can build your own queries as you like.
52+
53+
### Querying the number of `totalSlots` and `usedSlots` in the grid :
54+
55+
```shell
56+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { totalSlots, usedSlots } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
57+
```
58+
59+
Generally on local machine the `<LINK_TO_GRAPHQL_ENDPOINT>` would be `http://localhost:4444/graphql`
60+
61+
### Querying the capabilities of each node in the grid :
62+
63+
```shell
64+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { nodes { capabilities } } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
65+
```
66+
67+
### Querying the status of each node in the grid :
68+
69+
```shell
70+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { nodes { status } } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
71+
```
72+
73+
### Querying the URI of each node and the grid :
74+
75+
```shell
76+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { nodes { uri }, uri } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
77+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: "GraphQL querying support"
3+
weight: 1
4+
---
5+
6+
{{% notice info %}}
7+
<i class="fas fa-language"></i> Page being translated from
8+
English to Japanese. Do you speak Japanese? Help us to translate
9+
it by sending us pull requests!
10+
{{% /notice %}}
11+
12+
GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. It gives users the power to ask for exactly what they need and nothing more.
13+
14+
## Enums
15+
Enums represent possible sets of values for a field.
16+
17+
For example, the `Node` object has a field called `status`. The state is an enum (specifically, of type `Status`) because it may be `UP` , `DRAINING` or `UNAVAILABLE`.
18+
19+
## Scalars
20+
Scalars are primitive values: `Int`, `Float`, `String`, `Boolean`, or `ID`.
21+
22+
When calling the GraphQL API, you must specify nested subfield until you return only scalars.
23+
24+
25+
## Structure of the Schema
26+
The structure of grid schema is as follows:
27+
28+
```shell
29+
{
30+
grid: {
31+
uri,
32+
totalSlots,
33+
usedSlots,
34+
nodes : [
35+
{
36+
id,
37+
uri,
38+
status,
39+
maxSession,
40+
capabilities
41+
}
42+
]
43+
}
44+
}
45+
```
46+
47+
## Querying GraphQL
48+
49+
The best way to query GraphQL is by using `curl` requests. GraphQL allows you to fetch only the data that you want, nothing more nothing less.
50+
51+
Some of the example GraphQL queries are given below. You can build your own queries as you like.
52+
53+
### Querying the number of `totalSlots` and `usedSlots` in the grid :
54+
55+
```shell
56+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { totalSlots, usedSlots } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
57+
```
58+
59+
Generally on local machine the `<LINK_TO_GRAPHQL_ENDPOINT>` would be `http://localhost:4444/graphql`
60+
61+
### Querying the capabilities of each node in the grid :
62+
63+
```shell
64+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { nodes { capabilities } } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
65+
```
66+
67+
### Querying the status of each node in the grid :
68+
69+
```shell
70+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { nodes { status } } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
71+
```
72+
73+
### Querying the URI of each node and the grid :
74+
75+
```shell
76+
curl -X POST -H "Content-Type: application/json" --data 'query { grid { nodes { uri }, uri } }' -s <LINK_TO_GRAPHQL_ENDPOINT>
77+
```

0 commit comments

Comments
 (0)