Skip to content

Commit

Permalink
Add gql to default config in apollo-language-server (#1176)
Browse files Browse the repository at this point in the history
Add .gql file extension do default config `includes` glob

Fixes #1128
  • Loading branch information
TLadd authored and trevor-scheer committed Apr 25, 2019
1 parent c99a7a7 commit 996d751
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 60 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- <First `apollo-graphql` related entry goes here>
- `apollo-language-server`
- Fix on-hover bugs introduced by replacing visitWithTypeInfo [#1196](https://github.com/apollographql/apollo-tooling/pull/1196)
- Add `gql` extension to the default `includes` configuration [#1176](https://github.com/apollographql/apollo-tooling/pull/1176)
- `apollo-tools`
- <First `apollo-tools` related entry goes here>
- `vscode-apollo`
Expand All @@ -35,7 +36,6 @@
- `[email protected]`
- Update `service:check`'s `--markdown` output to include clients affected, number of operations checked, pluralization improvements, and backticks around service and schema variant [#1164](https://github.com/apollographql/apollo-tooling/pull/1164)
- Update `service:check` output to show failures before passes [#1168](https://github.com/apollographql/apollo-tooling/pull/1168)
- `[email protected]`

## `[email protected]`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
ApolloConfig,
ApolloConfigFormat,
DefaultClientConfig,
DefaultServiceConfig
} from "../";
import { ApolloConfig, ApolloConfigFormat } from "../";
import URI from "vscode-uri";

describe("ApolloConfig", () => {
Expand Down Expand Up @@ -38,7 +33,7 @@ describe("ApolloConfig", () => {
expect(projects).toHaveLength(1);
expect(projects[0].isClient).toBeTruthy();
});
it("creates a ClientConfig when client is present", () => {
it("creates a ServiceConfig when service is present", () => {
const rawConfig: ApolloConfigFormat = { service: "my-service" };
const config = new ApolloConfig(rawConfig);
const projects = config.projects;
Expand Down
102 changes: 51 additions & 51 deletions packages/apollo-language-server/src/config/__tests__/loadConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,37 +78,37 @@ describe("loadConfig", () => {
configFileName: "my.config.js"
});
expect(config.rawConfig).toMatchInlineSnapshot(`
Object {
"client": Object {
"addTypename": true,
"clientOnlyDirectives": Array [
"connection",
"type",
],
"clientSchemaDirectives": Array [
"client",
"rest",
],
"excludes": Array [
"**/node_modules",
"**/__tests__",
],
"includes": Array [
"src/**/*.{ts,tsx,js,jsx,graphql}",
],
"service": "hello",
"statsWindow": Object {
"from": -86400,
"to": -0,
},
"tagName": "gql",
},
"engine": Object {
"endpoint": "https://engine-graphql.apollographql.com/api/graphql",
"frontend": "https://engine.apollographql.com",
},
}
`);
Object {
"client": Object {
"addTypename": true,
"clientOnlyDirectives": Array [
"connection",
"type",
],
"clientSchemaDirectives": Array [
"client",
"rest",
],
"excludes": Array [
"**/node_modules",
"**/__tests__",
],
"includes": Array [
"src/**/*.{ts,tsx,js,jsx,graphql,gql}",
],
"service": "hello",
"statsWindow": Object {
"from": -86400,
"to": -0,
},
"tagName": "gql",
},
"engine": Object {
"endpoint": "https://engine-graphql.apollographql.com/api/graphql",
"frontend": "https://engine.apollographql.com",
},
}
`);
});

it("loads with service defaults from different dir", async () => {
Expand All @@ -127,26 +127,26 @@ Object {
configFileName: "my.config.js"
});
expect(config.rawConfig).toMatchInlineSnapshot(`
Object {
"engine": Object {
"endpoint": "https://engine-graphql.apollographql.com/api/graphql",
"frontend": "https://engine.apollographql.com",
},
"service": Object {
"endpoint": Object {
"url": "http://localhost:4000/graphql",
},
"excludes": Array [
"**/node_modules",
"**/__tests__",
],
"includes": Array [
"src/**/*.{ts,tsx,js,jsx,graphql}",
],
"name": "hello",
},
}
`);
Object {
"engine": Object {
"endpoint": "https://engine-graphql.apollographql.com/api/graphql",
"frontend": "https://engine.apollographql.com",
},
"service": Object {
"endpoint": Object {
"url": "http://localhost:4000/graphql",
},
"excludes": Array [
"**/node_modules",
"**/__tests__",
],
"includes": Array [
"src/**/*.{ts,tsx,js,jsx,graphql,gql}",
],
"name": "hello",
},
}
`);
});

it("[deprecated] loads config from package.json", async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-language-server/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const DefaultEngineConfig = {
};

export const DefaultConfigBase = {
includes: ["src/**/*.{ts,tsx,js,jsx,graphql}"],
includes: ["src/**/*.{ts,tsx,js,jsx,graphql,gql}"],
excludes: ["**/node_modules", "**/__tests__"]
};

Expand Down

0 comments on commit 996d751

Please sign in to comment.