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