Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gql to default config in apollo-language-server #1176

Merged
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
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