Skip to content

Commit 1edeb36

Browse files
Resolve missing types "Boolean", "String" (#1355)
A change to buildClientSchema removed some behavior that we depended on. Previously, with caching in place, basic types (Boolean, String, ...) were returned even if they didn't exist in typeMap. The "fix" was itself a breaking change, adding basic types that weren't previously added to the typeMap. Full discussion here: graphql/graphql-js@183ff32#r32971387 This commit addresses a couple issues: 1) Request the built in types from Engine 2) Disallow versions of graphql that include the broken fix The broken fix causes a regression for service:push. During the broken fix (graphql@14.2.1 - 14.3.0), ALL built in types are included during buildClientSchema (even if they're not part of the schema). This causes a hash mismatch between the pushed schema and the schema hash that Apollo Server recognizes.
1 parent ad3676b commit 1edeb36

5 files changed

Lines changed: 10 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Upcoming
44

55
- `apollo`
6-
- <First `apollo-codegen-core` related entry goes here>
6+
- Relax graphql version, resolve missing types "Boolean", "String" [#1355](https://github.com/apollographql/apollo-tooling/pull/1355)
77
- `apollo-codegen-core`
88
- <First `apollo-codegen-core` related entry goes here>
99
- `apollo-codegen-flow`

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/apollo-language-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"cosmiconfig": "^5.0.6",
3333
"dotenv": "^8.0.0",
3434
"glob": "^7.1.3",
35-
"graphql": "~14.2.1",
35+
"graphql": "14.0.2 - 14.2.0 || ^14.3.1",
3636
"graphql-tag": "^2.10.1",
3737
"lodash.debounce": "^4.0.8",
3838
"lodash.merge": "^4.6.1",

packages/apollo-language-server/src/providers/schema/engine.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
// EngineSchemaProvider (engine schema reg => schema)
22
import { NotificationHandler } from "vscode-languageserver";
3-
43
import gql from "graphql-tag";
5-
6-
import {
7-
GraphQLSchema,
8-
buildClientSchema,
9-
IntrospectionSchema,
10-
IntrospectionQuery
11-
} from "graphql";
12-
4+
import { GraphQLSchema, buildClientSchema } from "graphql";
135
import { ApolloEngineClient, ClientIdentity } from "../../engine";
146
import { ClientConfig, parseServiceSpecifier } from "../../config";
157
import {
@@ -101,7 +93,7 @@ export const SCHEMA_QUERY = gql`
10193
subscriptionType {
10294
name
10395
}
104-
types {
96+
types(filter: { includeBuiltInTypes: true }) {
10597
...IntrospectionFullType
10698
}
10799
directives {

packages/apollo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"git-parse": "1.0.3",
5555
"git-rev-sync": "1.12.0",
5656
"glob": "7.1.4",
57-
"graphql": "~14.2.1",
57+
"graphql": "14.0.2 - 14.2.0 || ^14.3.1",
5858
"graphql-tag": "2.10.1",
5959
"heroku-cli-util": "8.0.11",
6060
"listr": "0.14.3",

0 commit comments

Comments
 (0)