-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
relay.config.js
57 lines (54 loc) · 1.86 KB
/
relay.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
// @flow strict
const shouldPersist = process.env.RELAY_ENABLE_PERSIST === 'true';
// RELAY_ENABLE_PERSIST=true ./node_modules/.bin/relay-compiler --repersist
const abacusPersistConfig /*: $FlowFixMe */ =
shouldPersist === true
? {
persist: {
url: 'https://abacus.kochka.com.mx/graphql/persist',
concurrency: 10,
params: {},
},
}
: {};
// See: https://github.com/facebook/relay/tree/main/packages/relay-compiler#configuration
module.exports = {
root: '.',
sources: {
'src/abacus-backoffice': 'abacus',
'src/abacus-kochka': 'abacus',
},
excludes: ['**/__flowtests__/**'],
codegenCommand: './x relay',
projects: {
abacus: {
language: 'flow',
schema: 'src/abacus/schema.graphql',
// Require all GraphQL scalar types mapping to be defined, will throw if a GraphQL scalar
// type doesn't have a JS type.
requireCustomScalarTypes: true,
// A map from GraphQL scalar types to a custom JS type, example:
// { "Url": "string" }
customScalarTypes: {
ProductImageUploadable: 'string',
},
// Optional regex to restrict `@relay_test_operation` directive to directories matching this
// regex (so it cannot be used in production code by accident).
testPathRegex: '__tests__',
featureFlags: {
compact_query_text: { kind: 'enabled' },
no_inline: { kind: 'enabled' },
enable_strict_custom_scalars: true,
},
schemaConfig: {
// Name of the globally unique ID field on the `Node` interface.
nodeInterfaceIdField: 'id',
// Restricts the type of all fields named `id` to `ID`.
// Learn why: https://github.com/facebook/relay/commit/d0a39283d45854922119b779c4ac7014fd402d20
nonNodeIdFields: {},
},
...abacusPersistConfig,
},
},
isDevVariableName: '__DEV__',
};