-
Notifications
You must be signed in to change notification settings - Fork 0
/
codegen.js
44 lines (42 loc) · 1002 Bytes
/
codegen.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
/** Configuration for graphql-codegen */
const dotenv = require('dotenv');
const fs = require('fs');
// Use .env for configuration and .env.dist as fallback
const DOTENV_CONFIG = { path: './.env.dist' };
if (fs.existsSync('./.env')) DOTENV_CONFIG.path = './.env';
dotenv.config(DOTENV_CONFIG);
module.exports = {
"schema": [
{
[process.env.REACT_APP_HTTP_BACKEND_LINK]: {
"headers": {
"X-Hasura-Admin-Secret": process.env.HASURA_GRAPHQL_ADMIN_SECRET
}
}
}
],
"documents": [
"./src/data/**/*.graphql"
],
"overwrite": true,
"generates": {
"./src/api/generated/graphql.tsx": {
"plugins": [
"typescript",
"typescript-operations",
"typescript-react-apollo"
],
"config": {
"skipTypename": false,
"withHooks": true,
"withHOC": false,
"withComponent": false
}
},
"./graphql.schema.json": {
"plugins": [
"introspection"
]
}
}
};