Skip to content

Commit

Permalink
Resolve missing types "Boolean", "String" (#1355)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
trevor-scheer committed Jun 27, 2019
1 parent ad3676b commit 1edeb36
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -3,7 +3,7 @@
## Upcoming

- `apollo`
- <First `apollo-codegen-core` related entry goes here>
- Relax graphql version, resolve missing types "Boolean", "String" [#1355](https://github.com/apollographql/apollo-tooling/pull/1355)
- `apollo-codegen-core`
- <First `apollo-codegen-core` related entry goes here>
- `apollo-codegen-flow`
Expand Down
10 changes: 5 additions & 5 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 packages/apollo-language-server/package.json
Expand Up @@ -32,7 +32,7 @@
"cosmiconfig": "^5.0.6",
"dotenv": "^8.0.0",
"glob": "^7.1.3",
"graphql": "~14.2.1",
"graphql": "14.0.2 - 14.2.0 || ^14.3.1",
"graphql-tag": "^2.10.1",
"lodash.debounce": "^4.0.8",
"lodash.merge": "^4.6.1",
Expand Down
12 changes: 2 additions & 10 deletions packages/apollo-language-server/src/providers/schema/engine.ts
@@ -1,15 +1,7 @@
// EngineSchemaProvider (engine schema reg => schema)
import { NotificationHandler } from "vscode-languageserver";

import gql from "graphql-tag";

import {
GraphQLSchema,
buildClientSchema,
IntrospectionSchema,
IntrospectionQuery
} from "graphql";

import { GraphQLSchema, buildClientSchema } from "graphql";
import { ApolloEngineClient, ClientIdentity } from "../../engine";
import { ClientConfig, parseServiceSpecifier } from "../../config";
import {
Expand Down Expand Up @@ -101,7 +93,7 @@ export const SCHEMA_QUERY = gql`
subscriptionType {
name
}
types {
types(filter: { includeBuiltInTypes: true }) {
...IntrospectionFullType
}
directives {
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo/package.json
Expand Up @@ -54,7 +54,7 @@
"git-parse": "1.0.3",
"git-rev-sync": "1.12.0",
"glob": "7.1.4",
"graphql": "~14.2.1",
"graphql": "14.0.2 - 14.2.0 || ^14.3.1",
"graphql-tag": "2.10.1",
"heroku-cli-util": "8.0.11",
"listr": "0.14.3",
Expand Down

0 comments on commit 1edeb36

Please sign in to comment.