Skip to content

Latest commit

 

History

History

graphql-config

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

@relay-graphql-js/graphql-config

npm build

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 @argumentDefinitions and @arguments directives.
  • uses your locally installed graphql version!
  • multiple environments are not supported yet but are coming soon!

Changelog

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 config

Or, in your graphql.config.js file:

const { config } = require("@relay-graphql-js/graphql-config").generateConfig()
module.exports = config

Why 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!