relay-compiler 0.0.0-main-3328e8dd → 0.0.0-main-edd32144
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +52 -53
- package/linux-x64/relay +0 -0
- package/macos-arm64/relay +0 -0
- package/macos-x64/relay +0 -0
- package/package.json +1 -1
- package/win-x64/relay.exe +0 -0
package/README.md
CHANGED
@@ -27,10 +27,11 @@ containing `graphql` literals) and the GraphQL schema for the project.
|
|
27
27
|
}
|
28
28
|
}
|
29
29
|
```
|
30
|
+
|
30
31
|
Relay Compiler will automatically discover the config if:
|
31
32
|
|
32
33
|
- There is a `relay.config.json`, `relay.config.js` file at the root of the
|
33
|
-
project (i.e. in the same folder as the `package.json` file).
|
34
|
+
project (i.e. in the same folder as the `package.json` file).
|
34
35
|
- The `package.json` file contains a `"relay"` key.
|
35
36
|
|
36
37
|
Additionally, this config file can be specified with the CLI argument `--config`
|
@@ -47,71 +48,69 @@ yarn relay --config ./relay.json
|
|
47
48
|
```
|
48
49
|
|
49
50
|
Please note, that if you pass configuration options via --cli arguments, you'll
|
50
|
-
need to provide a separate configuration for the
|
51
|
+
need to provide a separate configuration for the
|
52
|
+
[babel plugin](https://www.npmjs.com/package/babel-plugin-relay).
|
51
53
|
|
52
54
|
## File Finder
|
55
|
+
|
53
56
|
Relay compiler uses [`watchman`](https://facebook.github.io/watchman/) to find
|
54
|
-
file sources, and "listen" to the file
|
55
|
-
|
56
|
-
|
57
|
+
file sources, and "listen" to the file changes in the "watch" mode. If
|
58
|
+
`watchman` is not available, the compiler will use
|
59
|
+
[glob](https://docs.rs/glob/latest/glob/) to query the filesystem for files.
|
57
60
|
|
58
61
|
## Configuration
|
59
62
|
|
60
63
|
### Supported compiler configuration options
|
61
64
|
|
62
|
-
- `src`
|
63
|
-
- `schema`
|
64
|
-
|
65
|
-
- `
|
66
|
-
|
67
|
-
|
68
|
-
- `
|
69
|
-
|
70
|
-
|
71
|
-
- `
|
72
|
-
|
73
|
-
- `
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
65
|
+
- `src` Root directory of application code. [string] [required]
|
66
|
+
- `schema` Relative path to the file with GraphQL SDL file. [string] [required]
|
67
|
+
- `schemaConfig`
|
68
|
+
- `nodeInterfaceIdField` Configure the name of the globally unique ID field on
|
69
|
+
the Node interface. Useful if you can't use the default `id` field name.
|
70
|
+
[string][default: "id"]
|
71
|
+
- `artifactDirectory` A specific directory to output all artifacts to. When
|
72
|
+
enabling this the babel plugin needs `artifactDirectory` to be set as well.
|
73
|
+
[string]
|
74
|
+
- `language` The name of the language used for input files and generated
|
75
|
+
artifacts. ["flow" | "typescript"] [default: "flow"]
|
76
|
+
- `excludes` Directories to ignore under `src`. [array] [default:
|
77
|
+
["**/node_modules/**", "**/__mocks__/**", "**/__generated__/**"]]
|
78
|
+
- `schemaExtensions` List of directories with schema extensions. [array]
|
79
|
+
- `noFutureProofEnums` For `flow` only. This option controls whether or not a
|
80
|
+
catch-all entry is added to enum type definitions values that may be added in
|
81
|
+
the future. Enabling this means you will have to update your application
|
82
|
+
whenever the GraphQL server schema adds new enum values to prevent it from
|
83
|
+
breaking. [boolean][default: false]
|
84
|
+
- `customScalars` Mappings from custom scalars in your schema to built-in
|
85
|
+
GraphQL types, for type emission purposes. [object]
|
86
|
+
- `eagerEsModules` This option enables emitting ES modules artifacts.
|
87
|
+
[boolean][default: false]
|
84
88
|
- `persistConfig`
|
85
|
-
- `url`
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
[string]
|
98
|
-
- `jsModuleFormat` Formatting style for generated files. `commonjs`
|
99
|
-
or `haste`. Default is `commonjs`.
|
100
|
-
[string]
|
101
|
-
|
89
|
+
- `url` String, URL to send a POST request to to persist. This field is
|
90
|
+
required in `persistConfig` [string]
|
91
|
+
- `params` The document will be in a `POST` parameter `text`. This map can
|
92
|
+
contain additional parameters to send. [object]
|
93
|
+
- `concurrency` The maximum number concurrent requests that will be made to
|
94
|
+
`url`. Use a value greater than 0. [number]
|
95
|
+
- `codegenCommand` Command name that for relay compiler. [string]
|
96
|
+
|
97
|
+
- `isDevVariableName` Name of the global variable for dev mode (`__DEV__`).
|
98
|
+
[string]
|
99
|
+
- `jsModuleFormat` Formatting style for generated files. `commonjs` or `haste`.
|
100
|
+
Default is `commonjs`. [string]
|
102
101
|
|
103
102
|
### CLI configuration
|
104
103
|
|
105
104
|
We also support a limited set of CLI arguments that should cover the most cases
|
106
105
|
when you need to run the compiler.
|
107
106
|
|
108
|
-
- `--src`
|
109
|
-
- `--schema`
|
107
|
+
- `--src` Relative path to the source code.
|
108
|
+
- `--schema` Relative path to schema file.
|
110
109
|
- `--artifactDirectory` Compiler output directory.
|
111
|
-
- `--repersist`
|
112
|
-
- `--watch`
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
110
|
+
- `--repersist` Run the persister even if the query has not changed.
|
111
|
+
- `--watch` Run compiler in `watch` mode. Requires
|
112
|
+
[`watchman`](https://facebook.github.io/watchman/) to be installed.
|
113
|
+
- `--output` Output format of the compiler. Supported options: `debug` |
|
114
|
+
`verbose` | `quiet` | `quietWithErrors`. The default value is `verbose`.
|
115
|
+
- `--validate` Looks for pending changes and exits with non-zero code instead of
|
116
|
+
writing to disk.
|
package/linux-x64/relay
CHANGED
Binary file
|
package/macos-arm64/relay
CHANGED
Binary file
|
package/macos-x64/relay
CHANGED
Binary file
|
package/package.json
CHANGED
package/win-x64/relay.exe
CHANGED
Binary file
|