@relay-graphql-js/graphql-config
v0.1.0
Published
graphql-config compatibility layer for your relay project
Readme
@relay-graphql-js/graphql-config
This provides a simple configuration to may relay config to graphql-config.
Features:
- Reads user configuration from [relay-config], if the project is setup with it.
- Provides definitions for all Relay directives for validation and auto-completion purposes.
- Provides validation of
@argumentDefinitionsand@argumentsdirectives. - uses your locally installed
graphqlversion! - multiple environments are not supported yet but are coming soon!
Install
# using npm
npm install --save-dev @relay-graphql-js/graphql-config
# using yarn
yarn add --dev @relay-graphql-js/graphql-config(assuming graphql-config is installed already, which is used only for types)
Usage
In your graphql.config.ts file:
import { generateConfig } from "@relay-graphql-js/graphql-config"
const config = generateConfig();
export default configOr, in your graphql.config.js file:
const { config } = require("@relay-graphql-js/graphql-config").generateConfig()
module.exports = configWhy you might want to use this
Simply for tooling interoperability, if nothing else.
Limitations
This does not support relay environments => graphql-config projects, yet. Open a PR if you want it to!
