Commit graph

152 commits

Author SHA1 Message Date
Tim Roberts
d9590eeb5f Fix example link (#1682)
This PR adds a link to the `this example` link that was missing a URL.
2018-09-17 14:40:38 -07:00
Evans Hauser
8acedb7e2e
update changelog for release 2018-09-14 10:34:21 -07:00
C.J. Winslow
408198e5ac Pass the context request and response extension methods (#1547)
* Pass the context along to all the extension methods

Addresses #1343 

With this change you should now be able to implement an extension like so:

```javascript
class MyErrorTrackingExtension extends GraphQLExtension {
    willSendResponse(o) {
        const { context, graphqlResponse } = o

        context.trackErrors(graphqlResponse.errors)

        return o
    }
}
```

Edit by @evans :
fixes #1343
fixes #614 as the request object can be taken from context or from requestDidStart
fixes #631 ""

* Remove context from extra extension functions

The context shouldn't be necessary for format, parse, validation, and
execute. Format generally outputs the state of the extension. Parse and
validate don't depend on the context. Execution includes the context
argument as contextValue

* Move change entry under vNext
2018-09-07 18:10:30 -07:00
Martijn Walraven
c31d2e5747 Update CHANGELOG.md 2018-09-05 17:26:49 +02:00
Dries Vandermeulen
4ab7bb3f1a Fix apolo-server-micro top level error response (#1619)
Fixes #1581.
2018-09-05 16:03:04 +02:00
Vincenzo Russo
88417b7398 Switch ApolloServerBase.schema from private access to protected access (#1610) 2018-09-05 16:02:06 +02:00
Evans Hauser
4a409766a5 Add toggle for including error messages in reports (#1615)
Fixes #1613.

We always send traces that includes an error node if the trace has an
error. In the case that sending errors is disabled, we replace the
message and remove the location.

Note that the Engine proxy strips all error information from the traces
with noErrorTraces set. To get errors to show up in the ui, the proxy
sends error counts inside of the aggregated stats reports. To get
similar behavior inside of the apollo server metrics reporting, we
always send a trace and mask out the PII.
2018-09-05 16:01:14 +02:00
Marcel Miranda Ackerman
1348933d33 Fix Google Cloud Functions tests (#1616)
Closes #1601.
2018-09-05 15:54:42 +02:00
Shinya Ohira
6c44631657 Add node-fetch extensions typing (#1602) 2018-09-02 11:53:53 +02:00
Martijn Walraven
49d4ffb682 Augment typeDefs with cacheControl directive so SDL validation doesn't fail 2018-09-02 11:50:09 +02:00
Yipeng Zhao
984c47d07a Use playground default settings when possible (#1516)
Playground can either use external settings or its default settings (browser settings), in incompatible ways. The original implementation of default settings here would always provide 'settings' for Playground, in turn make its own settings mechanism disabled, with consequences such as altering settings in-browser cannot work as expect. Besides, once the default settings here go different with Playground provided, it would cause other problems.

The intention here is to use Playground setting as default, while explicit passing Playground settings in Apollo server would still work with defaults defined here merged.
2018-09-01 09:50:10 +02:00
Rob Richard
8d519c0550 Update changelog 2018-09-01 09:34:38 +02:00
Evans Hauser
2657e9b25b
Publish
- apollo-server-cloud-functions@2.0.1
 - apollo-server-cloudflare@2.0.2
 - apollo-server-core@2.0.4
 - apollo-server-express@2.0.4
 - apollo-server-hapi@2.0.4
 - apollo-server-integration-testsuite@2.0.4
 - apollo-server-koa@2.0.4
 - apollo-server-lambda@2.0.4
 - apollo-server-micro@2.0.4
 - apollo-server@2.0.5
2018-08-20 14:17:37 -07:00
Marcel Miranda Ackerman
724d9ff07d Implementation of Apollo Server 2 for Google Cloud Functions (#1446)
* Initial implementation of Apollo Server 2 for gcf

* First try at running with tests

* Updated naming

* Removed lambda mentions

* Simply use referer

* Updated README

* Updated Changelog

* Renamed gqlApollo to googleCloudApollo

* Added more details

* Removed extra check
2018-08-20 06:35:23 -04:00
Evans Hauser
ee7202efaf
update changelog to include bad build explaination 2018-08-16 15:20:11 -07:00
Evans Hauser
3e54e60ced
Publish
- apollo-server-cloudflare@2.0.1
 - apollo-server-core@2.0.3
 - apollo-server-express@2.0.3
 - apollo-server-hapi@2.0.3
 - apollo-server-integration-testsuite@2.0.3
 - apollo-server-koa@2.0.3
 - apollo-server-lambda@2.0.3
 - apollo-server-micro@2.0.3
 - apollo-server@2.0.3
2018-08-16 11:40:49 -07:00
Curtis Layne
0f17f7c50e Pass payload into the context function for subscriptions (#1513)
* Pass payload into the context function for subscriptions

The payload can be used for things like auth. You can pass a token on
the payload of the message and use it to fetch the user.

* Update CHANGELOG.md
2018-08-16 11:26:39 -07:00
Evans Hauser
efc5302930
Add option to mock the entire schema(i.e. set preserveResolvers) (#1546)
* add mockEntireSchema as configuration for preserveResolvers

* add mockEntireSchema to api reference

* add changelog
2018-08-16 11:21:13 -07:00
Evans Hauser
f7b5d63d03
Publish
- apollo-cache-control@0.2.2
 - apollo-datasource-rest@0.1.3
 - apollo-datasource@0.1.2
 - apollo-engine-reporting-protobuf@0.0.1
 - apollo-engine-reporting@0.0.2
 - apollo-server-cache-memcached@0.1.2
 - apollo-server-cache-redis@0.1.2
 - apollo-server-caching@0.1.2
 - apollo-server-cloudflare@2.0.0-rc.14
 - apollo-server-core@2.0.2
 - apollo-server-env@2.0.2
 - apollo-server-errors@2.0.2
 - apollo-server-express@2.0.2
 - apollo-server-hapi@2.0.2
 - apollo-server-integration-testsuite@2.0.2
 - apollo-server-koa@2.0.2
 - apollo-server-lambda@2.0.2
 - apollo-server-micro@2.0.2
 - apollo-server@2.0.2
 - apollo-tracing@0.2.2
 - graphql-extensions@0.1.2
2018-08-14 11:49:10 -07:00
Evans Hauser
ef82add05b
Publish
- apollo-cache-control@0.2.1
 - apollo-datasource-rest@0.1.2
 - apollo-datasource@0.1.1
 - apollo-engine-reporting-protobuf@0.0.0
 - apollo-engine-reporting@0.0.1
 - apollo-server-cache-memcached@0.1.1
 - apollo-server-cache-redis@0.1.1
 - apollo-server-caching@0.1.1
 - apollo-server-cloudflare@2.0.0-rc.13
 - apollo-server-core@2.0.1
 - apollo-server-env@2.0.1
 - apollo-server-errors@2.0.1
 - apollo-server-express@2.0.1
 - apollo-server-hapi@2.0.1
 - apollo-server-integration-testsuite@2.0.1
 - apollo-server-koa@2.0.1
 - apollo-server-lambda@2.0.1
 - apollo-server-micro@2.0.1
 - apollo-server@2.0.1
 - apollo-tracing@0.2.1
 - graphql-extensions@0.1.1
2018-08-14 11:05:31 -07:00
Jim (_nderscore)
412be208c1 Fixed GraphQL Playground with custom configuration in production. (#1495)
* Fixed support for GraphQL Playground with custom configuration in production environments.

* Updated logic in `createPlaygroundOptions` to cast the `playground` option to a boolean
  if it is defined. Fall back to `isDev` logic only if undefined.
* Updated unit test for partial graphql playground options to emulate a 'production'
  environment, mimicking the scenario that was broken before.

* Add PR #1495 to CHANGELOG.

* Restore partial playground options test when no `NODE_ENV`
2018-08-14 10:43:52 -07:00
Robin van der Vleuten
989481fea8 Allow additional Hapi route options to be passed (#1384)
* Allow additional route options to be passed

* Updated changelog with PR
2018-08-14 10:26:13 -07:00
Sashko Stubailo
8ca7380347 Look in event.path first when selecting endpoint for GraphQL Playground on Lambda, and check for null (#1527)
* Look in event.path first, and check for null

See here: https://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-api-gateway-request

* Add to changelog
2018-08-13 15:58:23 -04:00
Cedric TESNIERE
d6eca9729f docs: fix typo in CHANGELOG (#1478) 2018-08-06 15:38:36 -07:00
Wout Mertens
11abffb8ce express, koa: don't continue past playground render (#1436)
* server-express: don't continue past playground

* koa: remove extra next call after playground

* update changelog with remove next
2018-07-27 17:13:23 -07:00
Max Nachlinger
0b76e9ef00 Hapi: Pass toolkit to context function (#1407)
* Fix for #1382

* fix typo in changelog

* Added a few tests proving the response toolkit is passed into the context function
2018-07-27 16:49:55 -07:00
Evans Hauser
37d20cfe66
Import engine reporting protobuf and fix reporting readme (#1429)
* Initial revision

* Ensure dist directory exists

* Add envrc for direnv users.

* protobufjs is a runtime dependency

* 0.0.0-beta.2

* update reports.proto with FullTracesReport

* 0.0.0-beta.3

* depend on @types/long

* 0.0.0-beta.4

* instead, do not use long

* 0.0.0-beta.5

* Add Details.variablesJson

* 0.0.0-beta.6

* comment-only update to new field

* 0.0.0-beta.7

* update a-e-reporting readme to reflect production ready state

* update changelog the engine reporting

* reporting-protobuf: prepare -> prepublish
2018-07-26 17:39:11 -07:00
David Baumgold
2cf6617dbb Consistent lists in CHANGELOG.md (#1418)
Because VS Code likes to auto-format files
2018-07-25 15:39:22 +02:00
Evans Hauser
b9f8216e5f
update changelog to include rc 8-10 2018-07-17 15:43:10 -07:00
Evans Hauser
c800071afa
update changelog for RC's and betas 2018-07-13 17:22:16 -07:00
Evans Hauser
170f072f96
bring version-2 up to date 2018-07-13 13:14:19 -07:00
Tejas Kumar
7dc280df32 Fix Typo resovers -> resolvers (#1233)
* Fix Typo resovers -> resolvers

* Fix typo migh -> might

* Fix typo resover -> resolver again
2018-06-22 15:53:02 -07:00
Seth Madison
8072312b99
bump version of subscriptions-transport-ws for graphiql
The newer subscription client has a more forgiving default ka timeout
2018-05-11 15:54:24 -07:00
Evans Hauser
e58db229df
changelogs: added to root and apollo-server-core 2018-05-11 15:54:20 -07:00
David Glasser
8bd1ad0a6d CHANGELOG update 2018-04-24 11:32:30 -07:00
Jesse Rosenberger
6cddeaf463
Update CHANGELOG.md prior to v1.3.5 release. 2018-04-18 16:06:29 +03:00
Steve Rice
083a1ee60e Avoid TypeError when querystring is present, but query missing (#964)
The express-graphql reference implementation [provides a check]
(2e27a73358/src/index.js (L201-L208))
to protect against cases where a GET request is made that does not
have a `query` parameter where the GraphQL query would be present.

Without this guard, graphql-js's `parse` will return `undefined`
for the `DocumentNode` since it has no document to read. Subsequently
passing this to `isQueryOperation` results in a `TypeError`, because
we are providing `undefined` where `getOperationAst` [expects to get
a DocumentNode](5fe39262a3/src/utilities/getOperationAST.js (L19)).

A new test file is added for `runHttpQuery`, as one previously did
not seem to exist.
2018-04-18 15:38:57 +03:00
Jelle Breuer
0261870eb7 adonis: Set Content-type to application/json on response (#842)
* Set Content_Type to application/json on response

* Added changelog entry

* fixed styling
2018-04-17 21:49:26 +03:00
Michael Golfi
3dc9719268 Azure Functions now returns correct response body (#753)
* Added fixes to apolloAzureFunctions.js and sample functions for the GraphQL API and GraphiQL

* Added issue and pr details to changelog

* Maintain use of `context.done()`, but use `isRaw` instead.

Per the Azure documentation regarding the response object available at:

https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-node#response-object

* Switch Azure example to use CommonJS rather than native ESM exports.
2018-04-17 21:39:06 +03:00
Jonathan Jalouzot
afe5df4b4b FIX: Incorrect Content-Type for apollo-server-adonis (#910)
* FIX: Incorrect Content-Type for apollo-server-adonis

* feat: use response.type rather response.header

* Update CHANGELOG.md
2018-04-11 11:46:07 +03:00
David Glasser
7d1165f1e0
All: allow cacheControl: {defaultMaxAge: 5}. (#922) 2018-03-28 13:56:22 -07:00
David Glasser
0f7c1c53b4
Update CHANGELOG for all releases back to v1.1.3 (#915)
There were many missing releases and bullet points as well as inaccurate
ones. For example, it was impossible to figure out that users of Hapi 16 who
want to use Apollo Cache Control needed to use precisely version 1.2.0 of
apollo-server-hapi (which wasn't even mentioned).

Link to CHANGELOG from all READMEs. Add READMEs for the graphql-server-*
packages. Add an explanation of our versioning system to the top of
CHANGELOG.md.
2018-03-27 09:22:13 -07:00
Jesse Rosenberger
b7ce84185d
Update CHANGELOG.md for v1.3.3 prior to publishing. 2018-03-26 16:50:56 +03:00
Jesse Rosenberger
0ba31fd965 Re-word CHANGELOG.md message for #733. 2018-03-26 15:40:09 +03:00
Dan Dean
8954062eec Update CHANGELOG.md 2018-03-26 15:40:09 +03:00
Lukwago Allan
c9a372839d Re-export out GraphQLOptions in apollo-server-express (#871)
* Export `GraphQLOptions` type directly from `apollo-server-express`.

Directly export `GraphQLOptions` from the `apollo-server-express` (and
synonymously, `graphql-server-express`) main module, rather than exporting
it only from `./expressApollo`.
2018-03-16 12:48:40 +02:00
Sashko Stubailo
281392c3f0 Update to graphql@0.12 (#726)
* Update peer deps and tests for 0.12
* v1.3.2
2018-03-13 17:10:37 +02:00
Marvin Hagemeister
9e8984c2ee Inline all possible functions that are used only once (#821)
* Inline isFunction type-guard

* Don't redefine functions on doRunQuery

* Update CHANGELOG
2018-03-12 21:25:12 +02:00
Laurin Quast
df51fd90da Setup prettier (#724)
* Setup prettier and precommit hooks

* Format code with prettier

* Use husky because it works...

* Move prettier config to .prettierrc file

* Implement fixing markdown file formatting when running lint-fix script

* Format markdown files

* Add .json file formatting

* Fixes json file formatting

* Add pretteir linting step

* Remove tslint

* Use gitignore for prettier

* Fix linting errors

* Ignore submodule folder
2018-01-08 15:08:01 -08:00
Dom Armstrong
a8ae9042f5 Fix apollo-server-core runQuery breaks async_hook tracking (#733)
By creating a promise out of the execution flow the ability to trace the
async call stack is lost.
2017-12-22 05:46:02 +01:00