Skip to content
This repository has been archived by the owner on Sep 2, 2020. It is now read-only.

Switch to graphql-config #130

Merged
merged 5 commits into from
Jul 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ before_install:
- node resources/hoistDependencies.js
- mkdir -p node_modules
- (cd node_modules && ln -s ../packages/graphql-language-service-types)
- (cd node_modules && ln -s ../packages/graphql-language-service-config)
- (cd node_modules && ln -s ../packages/graphql-language-service-parser)
- (cd node_modules && ln -s ../packages/graphql-language-service-interface)
- (cd node_modules && ln -s ../packages/graphql-language-service-server)
Expand Down
25 changes: 1 addition & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,7 @@ The library includes a node executable file which you can find in `./node_module

### GraphQL configuration file (`.graphqlconfig`)

GraphQL Language Service, to provide its full feature set, will need to know some information about your GraphQL development environment. `.graphqlconfig` is a GraphQL configuration file that contains this information.
```
{
"projects": {
"product-name": {
"includeDirs": [
"/dir/paths/to/your/graphql/files"
],
"excludeDirs": [
"/dir/paths/to/ignore/"
],
"schemaPath": "/path/to/the/schema/" // supports `.graphql` IDL or `.json` file
}
}
}
```
`.graphqlconfig` can define mutliple configurations for each GraphQL environment, should you have more than one.

The GraphQL configurations will be used to perform two things in a nutshell:

1. Using `includeDirs` and `excludeDirs`, cache all fragment definitions per each product. This information will be used to compute dependencies between GraphQL queries and fragments.
2. Using `schemaPath`, build and cache `GraphQLSchema`s (per product). The schema will be used to perform query validations, autocomplete suggestions etc.

Also, if GraphQL Language Service receives an RPC message that contains the path of the file being operated on, `includDirs` and `excludeDirs` are used to determine which product configuration the file is associated with. Refer to [GraphQLConfig class](https://github.com/graphql/graphql-language-service/blob/master/packages/graphql-language-service-config/src/index.js) for more information.
Check out [graphql-config](https://github.com/graphcool/graphql-config)

### Using the command-line interface

Expand Down
99 changes: 66 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"babel-polyfill": "6.16.0",
"fb-watchman": "^2.0.0",
"graphql": "^0.10.5",
"graphql-language-service-config": "0.0.18",
"graphql-config": "~1.0.0",
"graphql-language-service-interface": "0.0.22",
"graphql-language-service-parser": "0.0.16",
"graphql-language-service-server": "0.0.34",
Expand Down
25 changes: 0 additions & 25 deletions packages/graphql-language-service-config/.babelrc

This file was deleted.

3 changes: 0 additions & 3 deletions packages/graphql-language-service-config/.npmignore

This file was deleted.

3 changes: 0 additions & 3 deletions packages/graphql-language-service-config/README.md

This file was deleted.

31 changes: 0 additions & 31 deletions packages/graphql-language-service-config/package.json

This file was deleted.

Loading