forked from glific/glific
-
Notifications
You must be signed in to change notification settings - Fork 0
/
graphQL.examples
149 lines (133 loc) · 2.3 KB
/
graphQL.examples
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# REST API TO login and create a user
$ curl -X POST -d "user[email][email protected]&user[password]=secret1234&user[password_confirmation]=secret1234" http://localhost:4000/api/v1/registration
{"data":{"renewal_token":"RENEW_TOKEN","access_token":"AUTH_TOKEN"}}
$ curl -X POST -d "user[email][email protected]&user[password]=secret1234" http://localhost:4000/api/v1/session
{"data":{"renewal_token":"RENEW_TOKEN","access_token":"AUTH_TOKEN"}}
$ curl -X DELETE -H "Authorization: AUTH_TOKEN" http://localhost:4000/api/v1/session
{"data":{}}
$ curl -X POST -H "Authorization: RENEW_TOKEN" http://localhost:4000/api/v1/session/renew
{"data":{"renewal_token":"RENEW_TOKEN","access_token":"AUTH_TOKEN"}}
query contact($id: ID!) {
contact(id: $ID) {
contact {
id
name
phone
}
errors {
key
message
}
}
}
mutation creLanguage($input:LanguageInput!) {
createLanguage(input: $input) {
language {
id
label
locale
}
errors {
key
message
}
}
}
query listContacts($filter: ContactFilter, $order: SortOrder) {
contacts(filter:$filter, order:$order) {
id
name
phone
}
}
query multipleOps() {
tags {
id
label
}
contacts {
id
name
phone
waId
}
}
query multipleOps() {
organizations {
id
name
}
}
query tag($id:ID!){
tag(id: $id) {
tag {
id
label
language {
id
label
}
isActive
}
errors {
key
message
}
}
}
mutation delTag($id: ID!) {
deleteTag(id: $id) {
tag {
id
}
errors {
key
message
}
}
}
mutation creTag($input:TagInput!) {
createTag(input: $input) {
tag {
id
label
language {
id
label
}
description
}
errors {
key
message
}
}
}
{
"id": "4",
"input": {
"label": "new tag 1234",
"languageId": "1"
}
}
mutation createOrganization($input: OrganizationInput!) {
createOrganization(input: $input) {
organization {
id
}
errors {
key
message
}
}
}
{
"input": {
"name": "Org",
"contact_name": "Jason",
"email": "[email protected]",
"provider": "gupshup",
"provider_key": "random",
"provider_number": "10101010101"
}
}