manifest
The object that names a generator and says which requests it exports.
Declaration
var manifest = {
id: string,
name: string,
group?: string,
language?: string,
fileExtension?: string,
order?: number,
kind?: 'http' | 'websocket'
};Overview
Every generator declares a top-level variable named manifest. Relay reads it when it loads the generator, before it ever calls generate, to list the generator in the Preview panel's format menu and in the Exporters pane of Relay > Settings.
var manifest = {
id: 'python-httpx',
name: 'HTTPX',
group: 'Python',
language: 'python',
fileExtension: 'py',
order: 32
};Keep the manifest a plain object literal. Relay evaluates the whole file to read it, so a syntax error anywhere in the file keeps the generator from loading.
Properties
Prop
Type
Discussion
Generators with the same order in a group are sorted by name, and groups with the same lowest order by their heading. Relay's built-in generators use these orders, so a value between two of them places yours there:
| Order | Group |
|---|---|
| 0 | Raw, without a group |
| 10–12 | Shell |
| 15 | PowerShell |
| 20–22 | JavaScript |
| 30–31 | Python |
| 40 | Go |
| 50–51 | Java |
| 60–61 | C# |
| 70–71 | PHP |
| 80 | Ruby |
| 90 | Swift |
| 100 | Kotlin |
| 110 | Rust |
| 120 | C |
A generator whose group matches a built-in group, such as 'Python', appears in that group.
A file without an id uses its file name as its id. Relay can't load a generator whose manifest is missing, has no name or names a kind other than 'http' or 'websocket', and leaves it out of the format menu.
See Also
- generate: The function that turns a request into code.
- Creating a custom code generator: Write a JavaScript generator that turns requests into code in the form you need.