-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhoudini.config.js
54 lines (52 loc) · 1014 Bytes
/
houdini.config.js
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
/// <references types="houdini-svelte">
/** @type {import('houdini').ConfigFile} */
const config = {
defaultPaginateMode: 'SinglePage',
watchSchema: {
interval: 0,
url: 'http://127.0.0.1:3000/graphql',
headers: {
'x-user-email': '[email protected]'
// cookie: 'session_id='
}
},
plugins: {
'houdini-svelte': {
forceRunesMode: true
}
},
scalars: {
Slug: { type: 'string' },
Cursor: { type: 'string' },
Date: {
type: 'Date',
unmarshal(val) {
return new Date(val);
},
// turn the value into something the API can use
marshal(d) {
if (typeof d === 'string') {
return d;
}
return (
d.getFullYear() +
'-' +
('0' + (d.getMonth() + 1)).slice(-2) +
'-' +
('0' + d.getDate()).slice(-2)
);
}
},
Time: {
type: 'Date',
unmarshal(val) {
return new Date(val);
},
// turn the value into something the API can use
marshal(date) {
return date.toISOString();
}
}
}
};
export default config;