Query (GET)
Performs a query in the GraphQL instance of the current site resolved for the request.
Note
The query
string must be a valid GraphQL query as described in the
official docs
Resource Information
This service uses the tomcat application on port 8080 by default. To see a list of default ports click here
The context for this API is /
.
HTTP Verb
|
GET
|
URL
|
/api/1/site/graphql |
Response Formats
|
JSON |
Parameters
Name
|
Type
|
Required
|
Description
|
---|---|---|---|
query
|
String
|
✓
|
The GraphQL query
|
operationName
|
String
|
The GraphQL operation name
|
|
variables
|
String
|
A JSON object containing variables for the query
|
Example
Request
GET .../api/1/site/graphql.json?query={page_article{items{title}}}
Response
Status 200 OK
1{
2 "data": {
3 "page_article": {
4 "items": [
5 {
6 "title": "New ACME Phone Released Today"
7 },
8 {
9 "title": "Top Clubs In Virginia"
10 },
11 {
12 "title": "Coffee is Good for Your Health"
13 },
14 {
15 "title": "5 Popular Diets for Women"
16 },
17 {
18 "title": "Top Romantic Valentine Movies"
19 },
20 {
21 "title": "10 Tips to Get a Six Pack"
22 },
23 {
24 "title": "Women Styles for Winter"
25 },
26 {
27 "title": "Men Styles For Winter"
28 },
29 {
30 "title": "Top Books For Young Women"
31 }
32 ]
33 }
34 }
35}
Responses
Status
|
Location
|
Response Body
|
---|---|---|
200
|
See example above.
|
|
500
|
"Internal server error" |