0.1.0 • Published 3 years ago
relay-compiler-language-svelte v0.1.0
relay-compiler-language-svelte
A language plugin for Relay that adds Svelte support, and emits TypeScript type definitions.
This plugin is based on the relay-compiler-language-typescript
package.
Installation
Add the package to your dev dependencies:
# Install the Relay compiler:
yarn add relay-compiler --dev
# Install language support for Svelte:
yarn add relay-compiler-language-svelte --dev
Configuration
relay-compiler
You can configure the relay-compiler
to use the language plugin:
relay-compiler --src ./src --schema schema.graphql --language svelte
It's recommended that this is used as a package.json
script:
{
"scripts": {
"relay": "relay-compiler --src ./src --schema schema.graphql --language svelte"
}
}
If you use the relay-config
package, you can also configure this in the relay.config.js
file:
module.exports = {
src: './src',
schema: 'schema.graphql',
language: 'svelte',
};