Skip to content

Commit

Permalink
Switch to graphql-config (graphql#130)
Browse files Browse the repository at this point in the history
* Remove internal graphql-language-service-config

* Switch to graphql-config

* review fixes

* include/exclude -> includes/excludes

* Update to latest graphql-config
  • Loading branch information
RomanHotsiy authored and asiandrummer committed Jul 31, 2017
1 parent 8c80d45 commit 99c23d4
Show file tree
Hide file tree
Showing 32 changed files with 172 additions and 738 deletions.
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

0 comments on commit 99c23d4

Please sign in to comment.