-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraphQL Queries.txt
68 lines (64 loc) · 1.23 KB
/
GraphQL Queries.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Get all Books
query allBooks {
getAllBooks {
id
name
pageCount
status
author {
id
firstName
lastName
}
}
}
#Get all Authors
query allAuthors {
getAllAuthors {
id
firstName
lastName
}
}
# Search multiple books by specific book id's.
query bookDetails {
book1: bookById(id: "book-1") {
id
name
pageCount
status
author {
id
firstName
lastName
}
}
book2: bookById(id: "book-2") {
id
name
pageCount
status
author {
id
firstName
lastName
}
}
}
# Get all Books with a greater page count than or equal to 300.
query greaterPageCount{
bookByMinPageCount(minPageCount: 300){
id
name
pageCount
status
author {
id
firstName
lastName
}
}
}
curl -X POST -H "Content-Type: application/json" -d "{\"query\":\"query{getAllBooks{id name}}\"}" http://localhost:8080/graphql
curl -X POST -H "Content-Type: application/json" -d "{\"query\":\"query{bookByMinPageCount(minPageCount: 300){id name}}\"}" http://localhost:8080/graphql
curl -X POST -H "Content-Type: application/json" -d "{\"query\":\"query{bookById(id: \\\"book-2\\\"){id name}}\"}" http://localhost:8080/graphql