* Allow an optional function to resolve the rootValue
Passes the parsed DocumentNode AST to determine the root value,
useful when providing a different rootValue for query vs mutation
* Add API docs for rootValue
* Specify explicit `cursorShape` to avoid missing cursor in GraphQL Playground.
This solves a problem with the text cursor caret not being visible in the
operation input box within GraphQL Playground by explicitly setting a
GraphQL Playground configuration option called `cursorShape` to `line`.
All credit for the actual solution goes to @lpellegr for their discovery in
https://github.com/prisma/graphql-playground/issues/790#issuecomment-409221277
* Update CHANGELOG.md
The `generateClientInfo` API, used to set client identification attributes
within traces, is an experimental API and is subject to removal or change in
a future (major) Apollo Server release.
Ref: #1631
* Updated request handler to handle null or undefined req.path
* Added test for GCF handling request.path being null
* Updated Changelog
* Add note about checking for null path
* Provide ability to specify client info in traces
Adds the createClientInfo to apollo-engine-reporting, which enables the
differentiation of clients based on the request, operation, and
variables. This could be extended to include the response. However for
the first release. It doesn't quite make sense.
* Use extensions and context in createClientInfo
* Remove support for clientAddress
The frontend will not support it in the near future
* create -> generate and make default generator
createClientInfo -> generateClientInfo
* Clarify default values
* 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#1343fixes#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
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.
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.
* 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
* 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
* 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`
* 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
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.
* 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.
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.