Skip to content

Commit 996d751

Browse files
TLaddtrevor-scheer
authored andcommitted
Add gql to default config in apollo-language-server (#1176)
Add .gql file extension do default config `includes` glob Fixes #1128
1 parent c99a7a7 commit 996d751

4 files changed

Lines changed: 55 additions & 60 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
- <First `apollo-graphql` related entry goes here>
2121
- `apollo-language-server`
2222
- Fix on-hover bugs introduced by replacing visitWithTypeInfo [#1196](https://github.com/apollographql/apollo-tooling/pull/1196)
23+
- Add `gql` extension to the default `includes` configuration [#1176](https://github.com/apollographql/apollo-tooling/pull/1176)
2324
- `apollo-tools`
2425
- <First `apollo-tools` related entry goes here>
2526
- `vscode-apollo`
@@ -35,7 +36,6 @@
3536
- `apollo@2.8.2`
3637
- 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)
3738
- Update `service:check` output to show failures before passes [#1168](https://github.com/apollographql/apollo-tooling/pull/1168)
38-
- `apollo-language-server@1.6.3`
3939

4040
## `apollo@2.8.1`
4141

packages/apollo-language-server/src/config/__tests__/config.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import {
2-
ApolloConfig,
3-
ApolloConfigFormat,
4-
DefaultClientConfig,
5-
DefaultServiceConfig
6-
} from "../";
1+
import { ApolloConfig, ApolloConfigFormat } from "../";
72
import URI from "vscode-uri";
83

94
describe("ApolloConfig", () => {
@@ -38,7 +33,7 @@ describe("ApolloConfig", () => {
3833
expect(projects).toHaveLength(1);
3934
expect(projects[0].isClient).toBeTruthy();
4035
});
41-
it("creates a ClientConfig when client is present", () => {
36+
it("creates a ServiceConfig when service is present", () => {
4237
const rawConfig: ApolloConfigFormat = { service: "my-service" };
4338
const config = new ApolloConfig(rawConfig);
4439
const projects = config.projects;

packages/apollo-language-server/src/config/__tests__/loadConfig.ts

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -78,37 +78,37 @@ describe("loadConfig", () => {
7878
configFileName: "my.config.js"
7979
});
8080
expect(config.rawConfig).toMatchInlineSnapshot(`
81-
Object {
82-
"client": Object {
83-
"addTypename": true,
84-
"clientOnlyDirectives": Array [
85-
"connection",
86-
"type",
87-
],
88-
"clientSchemaDirectives": Array [
89-
"client",
90-
"rest",
91-
],
92-
"excludes": Array [
93-
"**/node_modules",
94-
"**/__tests__",
95-
],
96-
"includes": Array [
97-
"src/**/*.{ts,tsx,js,jsx,graphql}",
98-
],
99-
"service": "hello",
100-
"statsWindow": Object {
101-
"from": -86400,
102-
"to": -0,
103-
},
104-
"tagName": "gql",
105-
},
106-
"engine": Object {
107-
"endpoint": "https://engine-graphql.apollographql.com/api/graphql",
108-
"frontend": "https://engine.apollographql.com",
109-
},
110-
}
111-
`);
81+
Object {
82+
"client": Object {
83+
"addTypename": true,
84+
"clientOnlyDirectives": Array [
85+
"connection",
86+
"type",
87+
],
88+
"clientSchemaDirectives": Array [
89+
"client",
90+
"rest",
91+
],
92+
"excludes": Array [
93+
"**/node_modules",
94+
"**/__tests__",
95+
],
96+
"includes": Array [
97+
"src/**/*.{ts,tsx,js,jsx,graphql,gql}",
98+
],
99+
"service": "hello",
100+
"statsWindow": Object {
101+
"from": -86400,
102+
"to": -0,
103+
},
104+
"tagName": "gql",
105+
},
106+
"engine": Object {
107+
"endpoint": "https://engine-graphql.apollographql.com/api/graphql",
108+
"frontend": "https://engine.apollographql.com",
109+
},
110+
}
111+
`);
112112
});
113113

114114
it("loads with service defaults from different dir", async () => {
@@ -127,26 +127,26 @@ Object {
127127
configFileName: "my.config.js"
128128
});
129129
expect(config.rawConfig).toMatchInlineSnapshot(`
130-
Object {
131-
"engine": Object {
132-
"endpoint": "https://engine-graphql.apollographql.com/api/graphql",
133-
"frontend": "https://engine.apollographql.com",
134-
},
135-
"service": Object {
136-
"endpoint": Object {
137-
"url": "http://localhost:4000/graphql",
138-
},
139-
"excludes": Array [
140-
"**/node_modules",
141-
"**/__tests__",
142-
],
143-
"includes": Array [
144-
"src/**/*.{ts,tsx,js,jsx,graphql}",
145-
],
146-
"name": "hello",
147-
},
148-
}
149-
`);
130+
Object {
131+
"engine": Object {
132+
"endpoint": "https://engine-graphql.apollographql.com/api/graphql",
133+
"frontend": "https://engine.apollographql.com",
134+
},
135+
"service": Object {
136+
"endpoint": Object {
137+
"url": "http://localhost:4000/graphql",
138+
},
139+
"excludes": Array [
140+
"**/node_modules",
141+
"**/__tests__",
142+
],
143+
"includes": Array [
144+
"src/**/*.{ts,tsx,js,jsx,graphql,gql}",
145+
],
146+
"name": "hello",
147+
},
148+
}
149+
`);
150150
});
151151

152152
it("[deprecated] loads config from package.json", async () => {

packages/apollo-language-server/src/config/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const DefaultEngineConfig = {
4747
};
4848

4949
export const DefaultConfigBase = {
50-
includes: ["src/**/*.{ts,tsx,js,jsx,graphql}"],
50+
includes: ["src/**/*.{ts,tsx,js,jsx,graphql,gql}"],
5151
excludes: ["**/node_modules", "**/__tests__"]
5252
};
5353

0 commit comments

Comments
 (0)