]> git.r.bdr.sh - rbdr/forum/blame - pacts/forumclient-forumserver.json
Add tests for actions + pacts for graphql errrors
[rbdr/forum] / pacts / forumclient-forumserver.json
CommitLineData
73973eda
RBR
1{
2 "consumer": {
b15225c9 3 "name": "ForumClient"
73973eda
RBR
4 },
5 "provider": {
b15225c9 6 "name": "ForumServer"
73973eda
RBR
7 },
8 "interactions": [
9 {
10 "description": "a request to list the forums",
b15225c9 11 "providerState": "there's data",
73973eda
RBR
12 "request": {
13 "method": "POST",
14 "path": "/graphql",
15 "headers": {
16 "content-type": "application/json"
17 },
18 "body": {
19 "operationName": "GetForums",
605230e0 20 "query": "query GetForums {\n forums {\n id\n glyph\n label\n position\n __typename\n }\n }",
73973eda
RBR
21 "variables": {
22 }
23 },
24 "matchingRules": {
25 "$.body.query": {
26 "match": "regex",
27 "regex": "query\\s*GetForums\\s*\\{\\s*forums\\s*\\{\\s*id\\s*glyph\\s*label\\s*position\\s*__typename\\s*\\}\\s*\\}"
28 }
29 }
30 },
31 "response": {
32 "status": 200,
33 "headers": {
34 "Content-Type": "application/json; charset=utf-8"
35 },
36 "body": {
37 "data": {
38 "forums": [
39 {
40 "id": "butter",
41 "glyph": "⌘",
42 "label": "test_forums.butter",
43 "position": 1
44 }
45 ]
46 }
47 },
48 "matchingRules": {
49 "$.body.data.forums": {
50 "min": 1
51 },
52 "$.body.data.forums[*].*": {
53 "match": "type"
54 },
55 "$.body.data.forums[*].id": {
56 "match": "type"
57 },
58 "$.body.data.forums[*].glyph": {
59 "match": "type"
60 },
61 "$.body.data.forums[*].label": {
62 "match": "type"
63 },
64 "$.body.data.forums[*].position": {
65 "match": "type"
66 }
67 }
68 }
fcbbc496
RBR
69 },
70 {
71 "description": "a request to get a single forum",
b15225c9 72 "providerState": "there's data",
fcbbc496
RBR
73 "request": {
74 "method": "POST",
75 "path": "/graphql",
76 "headers": {
77 "content-type": "application/json"
78 },
79 "body": {
80 "operationName": "GetForum",
605230e0 81 "query": "query GetForum($id: ID!) {\n forum(id: $id) {\n id\n glyph\n label\n position\n topics {\n id\n title\n updated_at\n ttl\n __typename\n }\n __typename\n }\n }",
fcbbc496
RBR
82 "variables": {
83 "id": "freezer"
84 }
85 },
86 "matchingRules": {
87 "$.body.query": {
88 "match": "regex",
89 "regex": "query\\s*GetForum\\(\\$id:\\s*ID!\\)\\s*\\{\\s*forum\\(id:\\s*\\$id\\)\\s*\\{\\s*id\\s*glyph\\s*label\\s*position\\s*topics\\s*\\{\\s*id\\s*title\\s*updated_at\\s*ttl\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*\\}"
90 }
91 }
92 },
93 "response": {
94 "status": 200,
95 "headers": {
96 "Content-Type": "application/json; charset=utf-8"
97 },
98 "body": {
99 "data": {
100 "forum": {
101 "id": "freezer",
102 "glyph": "✭",
103 "label": "test_forums.freezer",
104 "position": 3,
105 "topics": [
106 {
107 "id": "629de02c-151a-4db7-bb86-43b2add8a15a",
108 "title": "Very pacty topic",
109 "updated_at": 1619954611616,
110 "ttl": 3601
111 }
112 ]
113 }
114 }
115 },
116 "matchingRules": {
117 "$.body.data.forum": {
118 "match": "type"
119 },
120 "$.body.data.forum.glyph": {
121 "match": "type"
122 },
123 "$.body.data.forum.label": {
124 "match": "type"
125 },
126 "$.body.data.forum.position": {
127 "match": "type"
128 },
129 "$.body.data.forum.topics": {
130 "min": 1
131 },
132 "$.body.data.forum.topics[*].*": {
133 "match": "type"
134 },
135 "$.body.data.forum.topics[*].id": {
136 "match": "type"
137 },
138 "$.body.data.forum.topics[*].title": {
139 "match": "type"
140 },
141 "$.body.data.forum.topics[*].updated_at": {
142 "match": "type"
143 },
144 "$.body.data.forum.topics[*].ttl": {
145 "match": "type"
146 }
147 }
148 }
605230e0
RBR
149 },
150 {
151 "description": "a request to list the forums",
b15225c9 152 "providerState": "there's no data",
605230e0
RBR
153 "request": {
154 "method": "POST",
155 "path": "/graphql",
156 "headers": {
157 "content-type": "application/json"
158 },
159 "body": {
160 "operationName": "GetForums",
161 "query": "query GetForums {\n forums {\n id\n glyph\n label\n position\n __typename\n }\n }",
162 "variables": {
163 }
164 },
165 "matchingRules": {
166 "$.body.query": {
167 "match": "regex",
168 "regex": "query\\s*GetForums\\s*\\{\\s*forums\\s*\\{\\s*id\\s*glyph\\s*label\\s*position\\s*__typename\\s*\\}\\s*\\}"
169 }
170 }
171 },
172 "response": {
173 "status": 200,
174 "headers": {
175 "Content-Type": "application/json; charset=utf-8"
176 },
177 "body": {
178 "data": {
179 "forums": [
180
181 ]
182 }
183 }
184 }
185 },
186 {
187 "description": "a request to get a single forum",
b15225c9 188 "providerState": "there's no data",
605230e0
RBR
189 "request": {
190 "method": "POST",
191 "path": "/graphql",
192 "headers": {
193 "content-type": "application/json"
194 },
195 "body": {
196 "operationName": "GetForum",
197 "query": "query GetForum($id: ID!) {\n forum(id: $id) {\n id\n glyph\n label\n position\n topics {\n id\n title\n updated_at\n ttl\n __typename\n }\n __typename\n }\n }",
198 "variables": {
199 "id": "freezer"
200 }
201 },
202 "matchingRules": {
203 "$.body.query": {
204 "match": "regex",
205 "regex": "query\\s*GetForum\\(\\$id:\\s*ID!\\)\\s*\\{\\s*forum\\(id:\\s*\\$id\\)\\s*\\{\\s*id\\s*glyph\\s*label\\s*position\\s*topics\\s*\\{\\s*id\\s*title\\s*updated_at\\s*ttl\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*\\}"
206 }
207 }
208 },
209 "response": {
210 "status": 200,
211 "headers": {
212 "Content-Type": "application/json; charset=utf-8"
213 },
214 "body": {
215 "data": {
216 "forum": null
217 }
218 }
219 }
220 },
221 {
222 "description": "a request to list the forums",
26dfa00e 223 "providerState": "there's a server error",
605230e0
RBR
224 "request": {
225 "method": "POST",
226 "path": "/graphql",
227 "headers": {
228 "content-type": "application/json"
229 },
230 "body": {
231 "operationName": "GetForums",
232 "query": "query GetForums {\n forums {\n id\n glyph\n label\n position\n __typename\n }\n }",
233 "variables": {
234 }
235 },
236 "matchingRules": {
237 "$.body.query": {
238 "match": "regex",
239 "regex": "query\\s*GetForums\\s*\\{\\s*forums\\s*\\{\\s*id\\s*glyph\\s*label\\s*position\\s*__typename\\s*\\}\\s*\\}"
240 }
241 }
242 },
243 "response": {
244 "status": 500,
245 "headers": {
246 }
247 }
248 },
249 {
250 "description": "a request to get a single forum",
26dfa00e 251 "providerState": "there's a server error",
605230e0
RBR
252 "request": {
253 "method": "POST",
254 "path": "/graphql",
255 "headers": {
256 "content-type": "application/json"
257 },
258 "body": {
259 "operationName": "GetForum",
260 "query": "query GetForum($id: ID!) {\n forum(id: $id) {\n id\n glyph\n label\n position\n topics {\n id\n title\n updated_at\n ttl\n __typename\n }\n __typename\n }\n }",
261 "variables": {
262 "id": "freezer"
263 }
264 },
265 "matchingRules": {
266 "$.body.query": {
267 "match": "regex",
268 "regex": "query\\s*GetForum\\(\\$id:\\s*ID!\\)\\s*\\{\\s*forum\\(id:\\s*\\$id\\)\\s*\\{\\s*id\\s*glyph\\s*label\\s*position\\s*topics\\s*\\{\\s*id\\s*title\\s*updated_at\\s*ttl\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*\\}"
269 }
270 }
271 },
272 "response": {
273 "status": 500,
274 "headers": {
275 }
276 }
5fc4715f
RBR
277 },
278 {
26dfa00e
RBR
279 "description": "a request to list the forums",
280 "providerState": "there's an error in the response",
5fc4715f
RBR
281 "request": {
282 "method": "POST",
283 "path": "/graphql",
284 "headers": {
285 "content-type": "application/json"
286 },
287 "body": {
26dfa00e
RBR
288 "operationName": "GetForums",
289 "query": "query GetForums {\n forums {\n id\n glyph\n label\n position\n __typename\n }\n }",
5fc4715f 290 "variables": {
5fc4715f
RBR
291 }
292 },
293 "matchingRules": {
294 "$.body.query": {
295 "match": "regex",
26dfa00e 296 "regex": "query\\s*GetForums\\s*\\{\\s*forums\\s*\\{\\s*id\\s*glyph\\s*label\\s*position\\s*__typename\\s*\\}\\s*\\}"
5fc4715f
RBR
297 }
298 }
299 },
300 "response": {
301 "status": 200,
302 "headers": {
303 "Content-Type": "application/json; charset=utf-8"
304 },
305 "body": {
26dfa00e
RBR
306 "errors": [
307 {
308 "message": "An error occurred when fetching forums"
5fc4715f 309 }
26dfa00e 310 ]
5fc4715f
RBR
311 },
312 "matchingRules": {
26dfa00e 313 "$.body.errors": {
5fc4715f
RBR
314 "min": 1
315 },
26dfa00e 316 "$.body.errors[*].*": {
5fc4715f
RBR
317 "match": "type"
318 },
26dfa00e 319 "$.body.errors[*].message": {
5fc4715f
RBR
320 "match": "type"
321 }
322 }
323 }
324 },
325 {
26dfa00e
RBR
326 "description": "a request to get a single forum",
327 "providerState": "there's an error in the response",
5fc4715f
RBR
328 "request": {
329 "method": "POST",
330 "path": "/graphql",
331 "headers": {
332 "content-type": "application/json"
333 },
334 "body": {
26dfa00e
RBR
335 "operationName": "GetForum",
336 "query": "query GetForum($id: ID!) {\n forum(id: $id) {\n id\n glyph\n label\n position\n topics {\n id\n title\n updated_at\n ttl\n __typename\n }\n __typename\n }\n }",
5fc4715f 337 "variables": {
26dfa00e 338 "id": "freezer"
5fc4715f
RBR
339 }
340 },
341 "matchingRules": {
342 "$.body.query": {
343 "match": "regex",
26dfa00e 344 "regex": "query\\s*GetForum\\(\\$id:\\s*ID!\\)\\s*\\{\\s*forum\\(id:\\s*\\$id\\)\\s*\\{\\s*id\\s*glyph\\s*label\\s*position\\s*topics\\s*\\{\\s*id\\s*title\\s*updated_at\\s*ttl\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*\\}"
5fc4715f
RBR
345 }
346 }
347 },
348 "response": {
349 "status": 200,
350 "headers": {
351 "Content-Type": "application/json; charset=utf-8"
352 },
353 "body": {
26dfa00e
RBR
354 "errors": [
355 {
356 "message": "An error occurred when fetching the forum"
357 }
358 ]
5fc4715f
RBR
359 },
360 "matchingRules": {
26dfa00e
RBR
361 "$.body.errors": {
362 "min": 1
363 },
364 "$.body.errors[*].*": {
365 "match": "type"
366 },
367 "$.body.errors[*].message": {
368 "match": "type"
5fc4715f
RBR
369 }
370 }
5fc4715f 371 }
3435a35c
RBR
372 },
373 {
374 "description": "a request to get a single topic",
375 "providerState": "there's data",
376 "request": {
377 "method": "POST",
378 "path": "/graphql",
379 "headers": {
380 "content-type": "application/json"
381 },
382 "body": {
383 "operationName": "GetTopic",
384 "query": "query GetTopic($id: ID!) {\n topic(id: $id) {\n id\n title\n updated_at\n ttl\n forum {\n id\n glyph\n label\n __typename\n }\n tags {\n id\n weight\n __typename\n }\n posts {\n id\n text\n created_at\n author {\n id\n handle\n __typename\n }\n __typename\n }\n __typename\n }\n }",
385 "variables": {
386 "id": "0b58959d-d448-4a4e-84b6-35e5ac0028d1"
387 }
388 },
389 "matchingRules": {
390 "$.body.query": {
391 "match": "regex",
392 "regex": "query\\s*GetTopic\\(\\$id:\\s*ID!\\)\\s*\\{\\s*topic\\(id:\\s*\\$id\\)\\s*\\{\\s*id\\s*title\\s*updated_at\\s*ttl\\s*forum\\s*\\{\\s*id\\s*glyph\\s*label\\s*__typename\\s*\\}\\s*tags\\s*\\{\\s*id\\s*weight\\s*__typename\\s*\\}\\s*posts\\s*\\{\\s*id\\s*text\\s*created_at\\s*author\\s*\\{\\s*id\\s*handle\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*\\}"
393 }
394 }
395 },
396 "response": {
397 "status": 200,
398 "headers": {
399 "Content-Type": "application/json; charset=utf-8"
400 },
401 "body": {
402 "data": {
403 "topic": {
404 "id": "0b58959d-d448-4a4e-84b6-35e5ac0028d1",
405 "title": "The pacty topic of the day",
406 "updated_at": 1619979888906,
407 "ttl": 3399,
408 "forum": {
409 "id": "cucumber",
410 "glyph": "✽",
411 "label": "test_forums.cucumber"
412 },
413 "tags": [
414 {
415 "id": "skunk",
416 "weight": 44
417 }
418 ],
419 "posts": [
420 {
421 "id": "ed93530e-6f9c-4701-91ef-14f9e0ed3e26",
422 "text": "The content of this post is very relevant",
423 "created_at": 1619979889798,
424 "author": {
425 "id": "07fb2ba0-0945-464a-b215-873296710c8c",
426 "handle": "cucumber_fan92"
427 }
428 }
429 ]
430 }
431 }
432 },
433 "matchingRules": {
434 "$.body.data.topic.id": {
435 "match": "type"
436 },
437 "$.body.data.topic.title": {
438 "match": "type"
439 },
440 "$.body.data.topic.updated_at": {
441 "match": "type"
442 },
443 "$.body.data.topic.ttl": {
444 "match": "type"
445 },
446 "$.body.data.topic.forum.id": {
447 "match": "type"
448 },
449 "$.body.data.topic.forum.glyph": {
450 "match": "type"
451 },
452 "$.body.data.topic.forum.label": {
453 "match": "type"
454 },
455 "$.body.data.topic.tags": {
456 "min": 1
457 },
458 "$.body.data.topic.tags[*].*": {
459 "match": "type"
460 },
461 "$.body.data.topic.tags[*].id": {
462 "match": "type"
463 },
464 "$.body.data.topic.tags[*].weight": {
465 "match": "type"
466 },
467 "$.body.data.topic.posts": {
468 "min": 1
469 },
470 "$.body.data.topic.posts[*].*": {
471 "match": "type"
472 },
473 "$.body.data.topic.posts[*].id": {
474 "match": "type"
475 },
476 "$.body.data.topic.posts[*].text": {
477 "match": "type"
478 },
479 "$.body.data.topic.posts[*].created_at": {
480 "match": "type"
481 },
482 "$.body.data.topic.posts[*].author": {
483 "match": "type"
484 },
485 "$.body.data.topic.posts[*].author.id": {
486 "match": "type"
487 },
488 "$.body.data.topic.posts[*].author.handle": {
489 "match": "type"
490 }
491 }
492 }
493 },
494 {
495 "description": "a request to get a single topic",
496 "providerState": "there's no data",
497 "request": {
498 "method": "POST",
499 "path": "/graphql",
500 "headers": {
501 "content-type": "application/json"
502 },
503 "body": {
504 "operationName": "GetTopic",
505 "query": "query GetTopic($id: ID!) {\n topic(id: $id) {\n id\n title\n updated_at\n ttl\n forum {\n id\n glyph\n label\n __typename\n }\n tags {\n id\n weight\n __typename\n }\n posts {\n id\n text\n created_at\n author {\n id\n handle\n __typename\n }\n __typename\n }\n __typename\n }\n }",
506 "variables": {
507 "id": "0b58959d-d448-4a4e-84b6-35e5ac0028d1"
508 }
509 },
510 "matchingRules": {
511 "$.body.query": {
512 "match": "regex",
513 "regex": "query\\s*GetTopic\\(\\$id:\\s*ID!\\)\\s*\\{\\s*topic\\(id:\\s*\\$id\\)\\s*\\{\\s*id\\s*title\\s*updated_at\\s*ttl\\s*forum\\s*\\{\\s*id\\s*glyph\\s*label\\s*__typename\\s*\\}\\s*tags\\s*\\{\\s*id\\s*weight\\s*__typename\\s*\\}\\s*posts\\s*\\{\\s*id\\s*text\\s*created_at\\s*author\\s*\\{\\s*id\\s*handle\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*\\}"
514 }
515 }
516 },
517 "response": {
518 "status": 200,
519 "headers": {
520 "Content-Type": "application/json; charset=utf-8"
521 },
522 "body": {
523 "data": {
524 "topic": null
525 }
526 }
527 }
528 },
529 {
530 "description": "a request to get a single topic",
26dfa00e 531 "providerState": "there's a server error",
3435a35c
RBR
532 "request": {
533 "method": "POST",
534 "path": "/graphql",
535 "headers": {
536 "content-type": "application/json"
537 },
538 "body": {
539 "operationName": "GetTopic",
540 "query": "query GetTopic($id: ID!) {\n topic(id: $id) {\n id\n title\n updated_at\n ttl\n forum {\n id\n glyph\n label\n __typename\n }\n tags {\n id\n weight\n __typename\n }\n posts {\n id\n text\n created_at\n author {\n id\n handle\n __typename\n }\n __typename\n }\n __typename\n }\n }",
541 "variables": {
542 "id": "0b58959d-d448-4a4e-84b6-35e5ac0028d1"
543 }
544 },
545 "matchingRules": {
546 "$.body.query": {
547 "match": "regex",
548 "regex": "query\\s*GetTopic\\(\\$id:\\s*ID!\\)\\s*\\{\\s*topic\\(id:\\s*\\$id\\)\\s*\\{\\s*id\\s*title\\s*updated_at\\s*ttl\\s*forum\\s*\\{\\s*id\\s*glyph\\s*label\\s*__typename\\s*\\}\\s*tags\\s*\\{\\s*id\\s*weight\\s*__typename\\s*\\}\\s*posts\\s*\\{\\s*id\\s*text\\s*created_at\\s*author\\s*\\{\\s*id\\s*handle\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*\\}"
549 }
550 }
551 },
552 "response": {
553 "status": 500,
554 "headers": {
555 }
556 }
26dfa00e
RBR
557 },
558 {
559 "description": "a request to get a single topic",
560 "providerState": "there's an error in the response",
561 "request": {
562 "method": "POST",
563 "path": "/graphql",
564 "headers": {
565 "content-type": "application/json"
566 },
567 "body": {
568 "operationName": "GetTopic",
569 "query": "query GetTopic($id: ID!) {\n topic(id: $id) {\n id\n title\n updated_at\n ttl\n forum {\n id\n glyph\n label\n __typename\n }\n tags {\n id\n weight\n __typename\n }\n posts {\n id\n text\n created_at\n author {\n id\n handle\n __typename\n }\n __typename\n }\n __typename\n }\n }",
570 "variables": {
571 "id": "0b58959d-d448-4a4e-84b6-35e5ac0028d1"
572 }
573 },
574 "matchingRules": {
575 "$.body.query": {
576 "match": "regex",
577 "regex": "query\\s*GetTopic\\(\\$id:\\s*ID!\\)\\s*\\{\\s*topic\\(id:\\s*\\$id\\)\\s*\\{\\s*id\\s*title\\s*updated_at\\s*ttl\\s*forum\\s*\\{\\s*id\\s*glyph\\s*label\\s*__typename\\s*\\}\\s*tags\\s*\\{\\s*id\\s*weight\\s*__typename\\s*\\}\\s*posts\\s*\\{\\s*id\\s*text\\s*created_at\\s*author\\s*\\{\\s*id\\s*handle\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*\\}"
578 }
579 }
580 },
581 "response": {
582 "status": 200,
583 "headers": {
584 "Content-Type": "application/json; charset=utf-8"
585 },
586 "body": {
587 "errors": [
588 {
589 "message": "An error occurred when fetching the topic"
590 }
591 ]
592 },
593 "matchingRules": {
594 "$.body.errors": {
595 "min": 1
596 },
597 "$.body.errors[*].*": {
598 "match": "type"
599 },
600 "$.body.errors[*].message": {
601 "match": "type"
602 }
603 }
604 }
605 },
606 {
607 "description": "a request to get a single tag",
608 "providerState": "there's data",
609 "request": {
610 "method": "POST",
611 "path": "/graphql",
612 "headers": {
613 "content-type": "application/json"
614 },
615 "body": {
616 "operationName": "GetTag",
617 "query": "query GetTag($id: ID!) {\n tag(id: $id) {\n id\n topics {\n id\n title\n updated_at\n ttl\n __typename\n }\n __typename\n }\n }",
618 "variables": {
619 "id": "pineapple"
620 }
621 },
622 "matchingRules": {
623 "$.body.query": {
624 "match": "regex",
625 "regex": "query\\s*GetTag\\(\\$id:\\s*ID!\\)\\s*\\{\\s*tag\\(id:\\s*\\$id\\)\\s*\\{\\s*id\\s*topics\\s*\\{\\s*id\\s*title\\s*updated_at\\s*ttl\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*\\}"
626 }
627 }
628 },
629 "response": {
630 "status": 200,
631 "headers": {
632 "Content-Type": "application/json; charset=utf-8"
633 },
634 "body": {
635 "data": {
636 "tag": {
637 "id": "pineapple",
638 "topics": [
639 {
640 "id": "cd038ae7-e8b4-4e38-9543-3d697e69ac34",
641 "title": "This topic is about pineapples",
642 "updated_at": 1619978944077,
643 "ttl": 3555
644 }
645 ]
646 }
647 }
648 },
649 "matchingRules": {
650 "$.body.data.tag.id": {
651 "match": "type"
652 },
653 "$.body.data.tag.topics": {
654 "min": 1
655 },
656 "$.body.data.tag.topics[*].*": {
657 "match": "type"
658 },
659 "$.body.data.tag.topics[*].id": {
660 "match": "type"
661 },
662 "$.body.data.tag.topics[*].title": {
663 "match": "type"
664 },
665 "$.body.data.tag.topics[*].updated_at": {
666 "match": "type"
667 },
668 "$.body.data.tag.topics[*].ttl": {
669 "match": "type"
670 }
671 }
672 }
673 },
674 {
675 "description": "a request to get a single tag",
676 "providerState": "there's no data",
677 "request": {
678 "method": "POST",
679 "path": "/graphql",
680 "headers": {
681 "content-type": "application/json"
682 },
683 "body": {
684 "operationName": "GetTag",
685 "query": "query GetTag($id: ID!) {\n tag(id: $id) {\n id\n topics {\n id\n title\n updated_at\n ttl\n __typename\n }\n __typename\n }\n }",
686 "variables": {
687 "id": "pineapple"
688 }
689 },
690 "matchingRules": {
691 "$.body.query": {
692 "match": "regex",
693 "regex": "query\\s*GetTag\\(\\$id:\\s*ID!\\)\\s*\\{\\s*tag\\(id:\\s*\\$id\\)\\s*\\{\\s*id\\s*topics\\s*\\{\\s*id\\s*title\\s*updated_at\\s*ttl\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*\\}"
694 }
695 }
696 },
697 "response": {
698 "status": 200,
699 "headers": {
700 "Content-Type": "application/json; charset=utf-8"
701 },
702 "body": {
703 "data": {
704 "tag": null
705 }
706 }
707 }
708 },
709 {
710 "description": "a request to get a single tag",
711 "providerState": "there's a server error",
712 "request": {
713 "method": "POST",
714 "path": "/graphql",
715 "headers": {
716 "content-type": "application/json"
717 },
718 "body": {
719 "operationName": "GetTag",
720 "query": "query GetTag($id: ID!) {\n tag(id: $id) {\n id\n topics {\n id\n title\n updated_at\n ttl\n __typename\n }\n __typename\n }\n }",
721 "variables": {
722 "id": "pineapple"
723 }
724 },
725 "matchingRules": {
726 "$.body.query": {
727 "match": "regex",
728 "regex": "query\\s*GetTag\\(\\$id:\\s*ID!\\)\\s*\\{\\s*tag\\(id:\\s*\\$id\\)\\s*\\{\\s*id\\s*topics\\s*\\{\\s*id\\s*title\\s*updated_at\\s*ttl\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*\\}"
729 }
730 }
731 },
732 "response": {
733 "status": 500,
734 "headers": {
735 }
736 }
737 },
738 {
739 "description": "a request to get a single tag",
740 "providerState": "there's an error in the response",
741 "request": {
742 "method": "POST",
743 "path": "/graphql",
744 "headers": {
745 "content-type": "application/json"
746 },
747 "body": {
748 "operationName": "GetTag",
749 "query": "query GetTag($id: ID!) {\n tag(id: $id) {\n id\n topics {\n id\n title\n updated_at\n ttl\n __typename\n }\n __typename\n }\n }",
750 "variables": {
751 "id": "pineapple"
752 }
753 },
754 "matchingRules": {
755 "$.body.query": {
756 "match": "regex",
757 "regex": "query\\s*GetTag\\(\\$id:\\s*ID!\\)\\s*\\{\\s*tag\\(id:\\s*\\$id\\)\\s*\\{\\s*id\\s*topics\\s*\\{\\s*id\\s*title\\s*updated_at\\s*ttl\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*\\}"
758 }
759 }
760 },
761 "response": {
762 "status": 200,
763 "headers": {
764 "Content-Type": "application/json; charset=utf-8"
765 },
766 "body": {
767 "errors": [
768 {
769 "message": "An error occurred when fetching the tag"
770 }
771 ]
772 },
773 "matchingRules": {
774 "$.body.errors": {
775 "min": 1
776 },
777 "$.body.errors[*].*": {
778 "match": "type"
779 },
780 "$.body.errors[*].message": {
781 "match": "type"
782 }
783 }
784 }
785 },
786 {
787 "description": "a request to get a single post",
788 "providerState": "there's data",
789 "request": {
790 "method": "POST",
791 "path": "/graphql",
792 "headers": {
793 "content-type": "application/json"
794 },
795 "body": {
796 "operationName": "GetPost",
797 "query": "query GetPost($id: ID!) {\n post(id: $id) {\n id\n text\n created_at\n author {\n id\n handle\n __typename\n }\n topic {\n id\n title\n __typename\n }\n __typename\n }\n }",
798 "variables": {
799 "id": "8f75eba5-6989-4dd3-b466-e464546ce374"
800 }
801 },
802 "matchingRules": {
803 "$.body.query": {
804 "match": "regex",
805 "regex": "query\\s*GetPost\\(\\$id:\\s*ID!\\)\\s*\\{\\s*post\\(id:\\s*\\$id\\)\\s*\\{\\s*id\\s*text\\s*created_at\\s*author\\s*\\{\\s*id\\s*handle\\s*__typename\\s*\\}\\s*topic\\s*\\{\\s*id\\s*title\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*\\}"
806 }
807 }
808 },
809 "response": {
810 "status": 200,
811 "headers": {
812 "Content-Type": "application/json; charset=utf-8"
813 },
814 "body": {
815 "data": {
816 "post": {
817 "id": "8f75eba5-6989-4dd3-b466-e464546ce374",
818 "text": "This is a very pacty post",
819 "created_at": 1619976194937,
820 "author": {
821 "id": "a805b3de-cac4-451c-a1e6-f078869c9db9",
822 "handle": "pacts_person"
823 },
824 "topic": {
825 "id": "5c283ce1-0470-4b98-86f5-1fec9a22c9ac",
826 "title": "The parent pacts topic"
827 }
828 }
829 }
830 },
831 "matchingRules": {
832 "$.body.data.post": {
833 "match": "type"
834 },
835 "$.body.data.post.id": {
836 "match": "type"
837 },
838 "$.body.data.post.text": {
839 "match": "type"
840 },
841 "$.body.data.post.created_at": {
842 "match": "type"
843 },
844 "$.body.data.post.author": {
845 "match": "type"
846 },
847 "$.body.data.post.author.id": {
848 "match": "type"
849 },
850 "$.body.data.post.author.handle": {
851 "match": "type"
852 },
853 "$.body.data.post.topic": {
854 "match": "type"
855 },
856 "$.body.data.post.topic.id": {
857 "match": "type"
858 },
859 "$.body.data.post.topic.title": {
860 "match": "type"
861 }
862 }
863 }
864 },
865 {
866 "description": "a request to get a single post",
867 "providerState": "there's no data",
868 "request": {
869 "method": "POST",
870 "path": "/graphql",
871 "headers": {
872 "content-type": "application/json"
873 },
874 "body": {
875 "operationName": "GetPost",
876 "query": "query GetPost($id: ID!) {\n post(id: $id) {\n id\n text\n created_at\n author {\n id\n handle\n __typename\n }\n topic {\n id\n title\n __typename\n }\n __typename\n }\n }",
877 "variables": {
878 "id": "8f75eba5-6989-4dd3-b466-e464546ce374"
879 }
880 },
881 "matchingRules": {
882 "$.body.query": {
883 "match": "regex",
884 "regex": "query\\s*GetPost\\(\\$id:\\s*ID!\\)\\s*\\{\\s*post\\(id:\\s*\\$id\\)\\s*\\{\\s*id\\s*text\\s*created_at\\s*author\\s*\\{\\s*id\\s*handle\\s*__typename\\s*\\}\\s*topic\\s*\\{\\s*id\\s*title\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*\\}"
885 }
886 }
887 },
888 "response": {
889 "status": 200,
890 "headers": {
891 "Content-Type": "application/json; charset=utf-8"
892 },
893 "body": {
894 "data": {
895 "post": null
896 }
897 }
898 }
899 },
900 {
901 "description": "a request to get a single post",
902 "providerState": "there's a server error",
903 "request": {
904 "method": "POST",
905 "path": "/graphql",
906 "headers": {
907 "content-type": "application/json"
908 },
909 "body": {
910 "operationName": "GetPost",
911 "query": "query GetPost($id: ID!) {\n post(id: $id) {\n id\n text\n created_at\n author {\n id\n handle\n __typename\n }\n topic {\n id\n title\n __typename\n }\n __typename\n }\n }",
912 "variables": {
913 "id": "8f75eba5-6989-4dd3-b466-e464546ce374"
914 }
915 },
916 "matchingRules": {
917 "$.body.query": {
918 "match": "regex",
919 "regex": "query\\s*GetPost\\(\\$id:\\s*ID!\\)\\s*\\{\\s*post\\(id:\\s*\\$id\\)\\s*\\{\\s*id\\s*text\\s*created_at\\s*author\\s*\\{\\s*id\\s*handle\\s*__typename\\s*\\}\\s*topic\\s*\\{\\s*id\\s*title\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*\\}"
920 }
921 }
922 },
923 "response": {
924 "status": 500,
925 "headers": {
926 }
927 }
928 },
929 {
930 "description": "a request to get a single post",
931 "providerState": "there's an error in the response",
932 "request": {
933 "method": "POST",
934 "path": "/graphql",
935 "headers": {
936 "content-type": "application/json"
937 },
938 "body": {
939 "operationName": "GetPost",
940 "query": "query GetPost($id: ID!) {\n post(id: $id) {\n id\n text\n created_at\n author {\n id\n handle\n __typename\n }\n topic {\n id\n title\n __typename\n }\n __typename\n }\n }",
941 "variables": {
942 "id": "8f75eba5-6989-4dd3-b466-e464546ce374"
943 }
944 },
945 "matchingRules": {
946 "$.body.query": {
947 "match": "regex",
948 "regex": "query\\s*GetPost\\(\\$id:\\s*ID!\\)\\s*\\{\\s*post\\(id:\\s*\\$id\\)\\s*\\{\\s*id\\s*text\\s*created_at\\s*author\\s*\\{\\s*id\\s*handle\\s*__typename\\s*\\}\\s*topic\\s*\\{\\s*id\\s*title\\s*__typename\\s*\\}\\s*__typename\\s*\\}\\s*\\}"
949 }
950 }
951 },
952 "response": {
953 "status": 200,
954 "headers": {
955 "Content-Type": "application/json; charset=utf-8"
956 },
957 "body": {
958 "errors": [
959 {
960 "message": "An error occurred when fetching the post"
961 }
962 ]
963 },
964 "matchingRules": {
965 "$.body.errors": {
966 "min": 1
967 },
968 "$.body.errors[*].*": {
969 "match": "type"
970 },
971 "$.body.errors[*].message": {
972 "match": "type"
973 }
974 }
975 }
73973eda
RBR
976 }
977 ],
978 "metadata": {
979 "pactSpecification": {
980 "version": "2.0.0"
981 }
982 }
983}