Skip to content

Commit

Permalink
chore(deps): update dependency graphql to v15
Browse files Browse the repository at this point in the history
In a general sense this just updates tests to accommodate the new error
conditions and schema hashes since a lot of the work has already been done
in #3712 / 131c9b8.

A larger note is due to explain the updating the snapshots.  Those changes
are due the fact that types returned by, e.g.  `getImplementation`, will now
be dependent on the order that those types first appear in the schema.

See the referenced issues, the first of which implemented the change and the
second which indicates the motivation.

Ref: graphql/graphql-js#2410
Ref: graphql/graphql-js#2362
Ref: #3712 (131c9b8)
  • Loading branch information
abernix committed Jun 8, 2020
1 parent f840d9e commit e009f52
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 90 deletions.
11 changes: 4 additions & 7 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"express": "4.17.1",
"fastify": "2.14.1",
"form-data": "2.5.1",
"graphql": "14.6.0",
"graphql": "15.0.0",
"graphql-tag": "2.10.3",
"graphql-tools": "4.0.8",
"hapi": "17.8.5",
Expand Down
160 changes: 80 additions & 80 deletions packages/apollo-gateway/src/__tests__/buildQueryPlan.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -755,10 +755,10 @@ describe('buildQueryPlan', () => {
{
topProducts {
__typename
... on Book {
... on Furniture {
price
}
... on Furniture {
... on Book {
price
}
}
Expand Down Expand Up @@ -793,38 +793,38 @@ describe('buildQueryPlan', () => {
{
topProducts {
__typename
... on Book {
... on Furniture {
price
__typename
isbn
upc
}
... on Furniture {
... on Book {
price
__typename
upc
isbn
}
}
}
},
Flatten(path: "topProducts.@") {
Fetch(service: "reviews") {
{
... on Book {
__typename
isbn
}
... on Furniture {
__typename
upc
}
... on Book {
__typename
isbn
}
} =>
{
... on Book {
... on Furniture {
reviews {
body
}
}
... on Furniture {
... on Book {
reviews {
body
}
Expand Down Expand Up @@ -907,12 +907,12 @@ describe('buildQueryPlan', () => {
{
product(upc: "") {
__typename
... on Book {
... on Furniture {
details {
country
}
}
... on Furniture {
... on Book {
details {
country
}
Expand Down Expand Up @@ -965,17 +965,46 @@ describe('buildQueryPlan', () => {
}
fragment __QueryPlanFragment_0__ on Product {
__typename
... on Book {
__typename
isbn
}
... on Furniture {
__typename
upc
}
... on Book {
__typename
isbn
}
}
},
Parallel {
Flatten(path: "topReviews.@.product") {
Fetch(service: "product") {
{
... on Furniture {
__typename
upc
}
... on Book {
__typename
isbn
}
} =>
{
... on Furniture {
name
price
details {
country
}
}
... on Book {
price
details {
country
}
}
}
},
},
Sequence {
Flatten(path: "topReviews.@.product") {
Fetch(service: "books") {
Expand Down Expand Up @@ -1013,35 +1042,6 @@ describe('buildQueryPlan', () => {
},
},
},
Flatten(path: "topReviews.@.product") {
Fetch(service: "product") {
{
... on Furniture {
__typename
upc
}
... on Book {
__typename
isbn
}
} =>
{
... on Furniture {
name
price
details {
country
}
}
... on Book {
price
details {
country
}
}
}
},
},
},
},
}
Expand Down Expand Up @@ -1151,17 +1151,46 @@ describe('buildQueryPlan', () => {
}
fragment __QueryPlanFragment_0__ on Product {
__typename
... on Book {
__typename
isbn
}
... on Furniture {
__typename
upc
}
... on Book {
__typename
isbn
}
}
},
Parallel {
Flatten(path: "reviews.@.product") {
Fetch(service: "product") {
{
... on Furniture {
__typename
upc
}
... on Book {
__typename
isbn
}
} =>
{
... on Furniture {
name
cost: price
details {
origin: country
}
}
... on Book {
cost: price
details {
origin: country
}
}
}
},
},
Sequence {
Flatten(path: "reviews.@.product") {
Fetch(service: "books") {
Expand Down Expand Up @@ -1199,35 +1228,6 @@ describe('buildQueryPlan', () => {
},
},
},
Flatten(path: "reviews.@.product") {
Fetch(service: "product") {
{
... on Furniture {
__typename
upc
}
... on Book {
__typename
isbn
}
} =>
{
... on Furniture {
name
cost: price
details {
origin: country
}
}
... on Book {
cost: price
details {
origin: country
}
}
}
},
},
},
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('ApolloGateway executor', () => {
});

expect(errors![0].message).toMatch(
'Variable "$first" got invalid value "3"; Expected type Int.',
'Variable "$first" got invalid value "3"; Int cannot represent non-integer value: "3"',
);
});

Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-core/src/__tests__/runQuery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ describe('runQuery', () => {
const invocation = requestDidStart.mock.calls[0][0];
expect(invocation).toHaveProperty('schema', schema);
expect(invocation).toHaveProperty( /* Shorter as a RegExp */
'schemaHash', expect.stringMatching(/^8ff87f3e0/));
'schemaHash', expect.stringMatching(/^cce9f33a/));
});
});

Expand Down

0 comments on commit e009f52

Please sign in to comment.