-
Notifications
You must be signed in to change notification settings - Fork 0
/
houdini.config.js
95 lines (89 loc) · 1.64 KB
/
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
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
/// <references types="houdini-svelte">
/** @type {import('houdini').ConfigFile} */
let config = {
watchSchema: {
url: 'http://localhost:8000/api/v1/graphql'
},
plugins: {
'houdini-svelte': {}
},
scalars: {
ESCreateUpdateResultType: {
type: '"created" | "updated" | "deleted"'
},
JSON: {
type: 'unknown'
},
Base64: {
type: 'string',
unmarshal(val) {
return val;
},
marshal(val) {
return val;
}
},
TypesTree: {
type: 'GeosTypesTree',
unmarshal(val) {
return val;
},
marshal(val) {
return val;
}
},
TypesPaths: {
type: 'Record<string, string[]>',
unmarshal(val) {
return val;
},
marshal(val) {
return val;
}
},
/* in your case, something like */
UUID: {
// <- The GraphQL Scalar
type: 'string' // <- The TypeScript type
},
DateTime: {
type: 'Date',
unmarshal(val) {
return val ? new Date(val) : null;
},
marshal(date /** @type {Date} */) {
return date && date.toISOString();
}
},
PythonTypingInfo: {
type: 'unknown'
}
}
};
if (typeof window === 'undefined') {
const { getConfig } = await import('@selenial/typed-config');
const houdiniConf = await getConfig({
domain: 'Houdini',
schema: {
schemaUrl: 'string',
watch: 'boolean',
static: 'boolean'
}
});
config = {
...config,
watchSchema: {
url: houdiniConf.schemaUrl
// headers: {
// Authorization(env) {
// return `Bearer 05785ac6-25eb-4c1f-80a1-c6f6a96c8e45`;
// }
// }
}
};
if (!houdiniConf.watch) {
config.watchSchema = undefined;
}
config.plugins['houdini-svelte'].static = houdiniConf.static;
}
export default config;