0.1.0 • Published 4 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 --devConfiguration
relay-compiler
You can configure the relay-compiler to use the language plugin:
relay-compiler --src ./src --schema schema.graphql --language svelteIt'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',
};