1.5.2 • Published 2 years ago

vscode-apollo-relay v1.5.2

Weekly downloads
1,806
License
MIT
Repository
github
Last release
2 years ago

vscode-apollo-relay

npm build

Simple configuration of vscode-apollo for Relay projects.

Features:

  • Read all 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.

Changelog

Install

# using npm
npm install --save vscode-apollo-relay

# using yarn
yarn add vscode-apollo-relay

Usage

In your apollo.config.js file:

const { config } = require("vscode-apollo-relay").generateConfig()
module.exports = config

Or, if you don’t use relay-config and the default values don’t work for you:

const path = require("path")
const {
  config,
  directivesFile,
  includesGlobPattern
} = require("vscode-apollo-relay").generateConfig()

module.exports = {
  client: {
    ...config.client,
    service: {
      ...config.client.service,
      localSchemaFile: "./path/to/schema.graphql",
    },
    includes: [
      directivesFile,
      path.join("./path/to/source", includesGlobPattern(["js", "jsx"]))
    ],
    excludes: ["./path/to/exclude"],
  }
}

Compat

If you are still using the compatibility mode of Relay you can enable additional validation rules that only apply to Relay compat. generateConfig takes a compat boolean argument to enable these extra validation rules. Ie:

const { config } = require("vscode-apollo-relay").generateConfig(/* compat: */ true)
module.exports = config

Development

# lint
yarn run lint

# build
yarn run build

# test
yarn run test

License

MIT © Eloy Durán

1.5.2

2 years ago

1.4.4

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.3

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago