Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into release-3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sachindshinde committed Jul 26, 2021
2 parents d22ffd3 + f567779 commit 7f1e5fb
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 29 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ The version headers in this history reflect the versions of Apollo Server itself

- _Nothing yet! Stay tuned!_

## v3.1.1

- `apollo-server-env`: Update `Headers.values()` type to match what `node-fetch` actually does and what the Fetch spec says it should be, and what `@types/node-fetch` [finally](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/54674) gets correct. [PR #5537](https://github.com/apollographql/apollo-server/pull/5537)

## v3.1.0

- `apollo-server-core`: If a client does not provide a value or provides null for a variable declared to be non-null, this is now reported as an error with an `extensions.code` of `BAD_USER_INPUT` rather than `INTERNAL_SERVER_ERROR`. (This is similar to a change we made in v2.23.0 for variables that are sent as the wrong type.) [PR #5508](https://github.com/apollographql/apollo-server/pull/5508) [Issue #5353](https://github.com/apollographql/apollo-server/issues/5353)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/plugin/usage-reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ Specify this function to create a signature for a query. This option is not reco
| Object | Description |
|--------|-------------|
| `{ none: true }` | If you provide this object, no request header names or values are sent to Apollo Studio. This is the default behavior. |
| `{ all: true }` | If you provide this object, **all** GraphQL header names and values are sent to Apollo Studio, except for the protected headers listed above. |
| `{ all: true }` | If you provide this object, **all** GraphQL header names and values are sent to Apollo Studio, except for the protected headers listed below. |
| `{ onlyNames: ["apple", "orange"]}`| If you provide an object with this structure, only names and values of the request headers with names that appear in the array are sent to Apollo Studio. Case-insensitive. |
| `{ exceptNames: ["apple", "orange"]}`| If you provide an object with this structure, all GraphQL header values **except** values of headers with names that appear in the array are sent to Apollo Studio. Case-insensitive. |

Expand Down
2 changes: 1 addition & 1 deletion docs/source/deployment/lambda.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ exports.handler = server.createHandler({
Because `apollo-server-lambda` is built on top of `apollo-server-express`, you can specify the same options that `apollo-server-express` accepts in `getMiddleware` (or `applyMiddleware`, other than `app`) as the `expressGetMiddlewareOptions` option to `createHandler`. The default value of this option is `{path: '/'}` (and this value of `path` will be used unless you explicitly override it). For example:

```js
exports.handler = server.createHandle({
exports.handler = server.createHandler({
expressGetMiddlewareOptions: {
disableHealthCheck: true,
}
Expand Down
4 changes: 2 additions & 2 deletions docs/source/testing/mocking.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ server.listen().then(({ url }) => {

## Mocking a schema using introspection

The GraphQL specification allows clients to introspect the schema with a [special set of types and fields](https://facebook.github.io/graphql/#sec-Introspection) that every schema must include. The results of a [standard introspection query](https://github.com/graphql/graphql-js/blob/master/src/utilities/getIntrospectionQuery.js) can be used to generate an instance of GraphQLSchema which can be mocked as explained above.
The GraphQL specification allows clients to introspect the schema with a [special set of types and fields](https://facebook.github.io/graphql/#sec-Introspection) that every schema must include. The results of a [standard introspection query](https://github.com/graphql/graphql-js/blob/main/src/utilities/getIntrospectionQuery.ts) can be used to generate an instance of GraphQLSchema which can be mocked as explained above.

This helps when you need to mock a schema defined in a language other than JS, for example Go, Ruby, or Python.

To convert an [introspection query](https://github.com/graphql/graphql-js/blob/master/src/utilities/getIntrospectionQuery.js) result to a `GraphQLSchema` object, you can use the `buildClientSchema` utility from the `graphql` package.
To convert an [introspection query](https://github.com/graphql/graphql-js/blob/main/src/utilities/getIntrospectionQuery.ts) result to a `GraphQLSchema` object, you can use the `buildClientSchema` utility from the `graphql` package.

```js
const { buildClientSchema } = require('graphql');
Expand Down
42 changes: 21 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@josephg/resolvable": "1.0.1",
"@sinonjs/fake-timers": "7.1.2",
"@types/async-retry": "1.4.3",
"@types/aws-lambda": "8.10.80",
"@types/aws-lambda": "8.10.81",
"@types/body-parser": "1.19.1",
"@types/bunyan": "1.8.7",
"@types/connect": "3.4.35",
Expand All @@ -83,8 +83,8 @@
"@types/lru-cache": "5.1.1",
"@types/memcached": "2.2.7",
"@types/micro": "7.3.6",
"@types/node": "12.20.16",
"@types/node-fetch": "2.5.11",
"@types/node": "12.20.17",
"@types/node-fetch": "2.5.12",
"@types/qs-middleware": "1.0.1",
"@types/request": "2.48.6",
"@types/request-promise": "4.1.48",
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-env/src/fetch.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export declare class Headers implements Iterable<[string, string]> {

entries(): Iterator<[string, string]>;
keys(): Iterator<string>;
values(): Iterator<[string]>;
values(): Iterator<string>;
[Symbol.iterator](): Iterator<[string, string]>;
}

Expand Down

0 comments on commit 7f1e5fb

Please sign in to comment.