-
Notifications
You must be signed in to change notification settings - Fork 0
/
handlers.ts
59 lines (58 loc) · 1.85 KB
/
handlers.ts
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
import {graphql, HttpResponse} from 'msw';
export const handlers = [
graphql.query('Header', ({query}) => {
console.log('Intercepted a "RecommendedProducts" GraphQL query:', query);
return HttpResponse.json({
data: {
shop: {
id: 'gid://shopify/Shop/68817551382',
name: 'Mock.shop',
description: '',
primaryDomain: {url: 'https://demostore.mock.shop'},
brand: {logo: null},
},
menu: {
id: 'gid://shopify/Menu/212407386134',
items: [
{
id: 'gid://shopify/MenuItem/494783037462',
resourceId: 'gid://shopify/Collection/429493780502',
tags: [],
title: 'Men',
type: 'COLLECTION',
url: 'https://demostore.mock.shop/collections/men',
items: [],
},
{
id: 'gid://shopify/MenuItem/494783070230',
resourceId: 'gid://shopify/Collection/429493813270',
tags: [],
title: 'Women',
type: 'COLLECTION',
url: 'https://demostore.mock.shop/collections/women',
items: [],
},
{
id: 'gid://shopify/MenuItem/494879670294',
resourceId: 'gid://shopify/Collection/429493846038',
tags: [],
title: 'Unisex',
type: 'COLLECTION',
url: 'https://demostore.mock.shop/collections/unisex',
items: [],
},
{
id: 'gid://shopify/MenuItem/496942514198',
resourceId: null,
tags: [],
title: 'Collections',
type: 'COLLECTIONS',
url: 'https://demostore.mock.shop/collections',
items: [],
},
],
},
},
});
}),
];