Commit graph

53 commits

Author SHA1 Message Date
Jesse Rosenberger
f6cdc94f29
docs: Remove suggestion that server is required for applyMiddleware.
The `server` attribute is neither required nor actually a valid property at all.

Closes #1413.
2019-02-20 20:41:04 +02:00
Jesse Rosenberger
e84aca256c
Update apollo-server.md to reflect new location of signature reference. 2019-02-01 20:40:28 +02:00
Pete Browne
ba0f4f559f docs: Fix bodyParserConfig in applyMiddleware (#2184) 2019-01-25 16:27:39 +02:00
Jesse Rosenberger
034383f491
Consistently use parent, rather than root, as first resolver argument.
In an effort to maintain consistency and semantically correct meaning,
this changes (only in documentation and internal Apollo Server tests) the
name of the first argument in resolver signatures to use `parent` rather
than `root`.

While `root` certainly makes sense when the resolver is belonging to the
root `Query` or `Mutation` type, once nested field resolvers begin getting
called, the more semantically correct term would seem to be `parent`.

Since `parent` still makes sense at the root level, and since resolvers
frequently get copied and pasted into more deeply-nested positions, putting
this pattern in place for apps which are just beginning might just help
someone more clearly understand the relationship in the future — without
incorrectly thinking that a nested resolver is accessing the root of the
graph, rather than the parent.
2018-11-16 20:37:26 +02:00
Evans Hauser
79e6a2ea42
Add client awareness reference api and some docs (#1927)
* Add client awareness reference api and some docs

* Reword and add default behavior to docs

* update clientReferenceId docs to be more explicit

* Update the generateClientInfo to use headers
2018-11-10 16:11:53 -08:00
Andre Eberhardt
b640be4fe6 feature(apollo-engine-reporting): Add custom http agent support (#1879)
This PR fixes #1836.

This PR enables developers to inject the http agent to be used on the network requests to apollo engine endpoint.

<!--
  Thanks for filing a pull request on GraphQL Server!

  Please look at the following checklist to ensure that your PR
  can be accepted quickly:
-->

TODO:

* [x] Update CHANGELOG.md with your change (include reference to issue & this PR)
* [x] Make sure all of the significant new logic is covered by tests
* [x] Rebase your changes on master so that they can be merged easily
* [x] Make sure all tests and linter rules pass

<!--**Pull Request Labels**

While not necessary, you can help organize our pull requests by labeling this issue when you open it.  To add a label automatically, simply [x] mark the appropriate box below:

- [ ] feature
- [ ] blocking
- [ ] docs

To add a label not listed above, simply place `/label another-label-name` on a line by itself.
-->
2018-10-26 20:14:18 +03:00
0xflotus
536b204de1 fixed arbitrarily (#1816) 2018-10-15 10:09:49 +03:00
Tim Griesser
4175f1b9cd Allow an optional function to resolve the rootValue (#1555)
* 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
2018-09-20 11:47:40 -07:00
Jesse Rosenberger
6d6c9ff268
Make it more clear that generateClientInfo is an experimental API.
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
2018-09-20 12:11:56 +03:00
Evans Hauser
96af44e41a
Provide ability to specify client info in traces (#1631)
* 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
2018-09-17 22:45:34 -07:00
Kornel Dubieniecki
e2ccc9c6ca Add express import in middleware apollo-server-express example (#1637) 2018-09-17 16:43:44 -07:00
ellord
39260da493 Small grammatical fix ("a" as opposed to "an") (#1655) 2018-09-17 16:43:04 -07: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
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
Jonas Hackenberg
9225426360 Add disabled introspection info (#1480)
Add info about disabled introspection in production
2018-08-14 10:29:04 -07:00
Sam Horton
16cd16d91a clarify typedefs API (#1389)
Add more accurate type information and example of using `typeDefs` in the `ApolloServer` constructor.
2018-07-25 22:40:32 +02:00
Jesse Rosenberger
67e047887f
docs: fix link to "Fetching data with resolvers.". 2018-07-19 15:00:24 -07:00
Jesse Rosenberger
3ce81e2c00
docs: Fix link to makeExecutableSchema. 2018-07-19 15:00:24 -07:00
Jesse Rosenberger
c94116e9a6
docs: Fix various links in the Apollo Server 2 documentation. (#1375)
Many of these links have changed as a result of page shuffling on other
repositories, such as the Engine documentation.
2018-07-19 10:52:07 -07:00
Evans Hauser
990d915aec
Apollo Server 2: Remove formatParams (#1331)
* remove formatParams

* remove formatParams from documentation

* check for valid query string after persisted query mapping

* fix sentence about different logging and label extensions as experimental

* mark graphql-extensions as more experimental
2018-07-13 09:44:13 -07:00
Adam Zionts
11b867114e Move gui option into constructor and use playground (#1297)
* Add a wider diversity of `gui` options

Although I know we want to remain less tied to the GraphQL Playground
GUI options, we definitely want to support a wider variety of options to
be passed in. This adds support for specifying partial options either
statically or dynamically for the gui, which can be extended to allow
for a wider array of guis than only GraphQL playground.

* Add boolean option and configuration for tabs

* move gui setting into ApolloServer Constructor

* document playground configuration in the constructor

* update playground types and fixed micro + koa integrations

* change gui to playground

* docs: change gui to playground

* fix logic for playground creation
2018-07-11 15:42:00 -07:00
Evans Hauser
de4760ba3b
Expose Cors option from vanilla ApolloServer constructor (#1335)
* add cors option to apollo-server's constructor

* docs: add cors option to costructor for apollo-server

* expose CorsOptions from vanilla and express integrations

* Update apollo-server.md
2018-07-11 13:46:51 -07:00
Danilo Bürger
314f0ecf43 Hint about Upload scalar when setting schema manually (#1318) 2018-07-09 14:40:22 -07:00
Evans Hauser
67c4812b45
docs: update engine option to ApolloServer constructor 2018-06-28 13:26:26 -07:00
Evans Hauser
738a933e81
docs: add persited query cache configuration 2018-06-28 12:43:32 -07:00
Evans Hauser
28cec7e92f
docs: Engine Reporting API and pass Engine API key in constructor (#1256)
- docs: add engine api and sync api key pass in with engine-docs
2018-06-27 10:00:49 -07:00
Evans Hauser
7ded129726 docs: replace registerServer with applyMiddleware 2018-06-14 11:57:30 -07:00
David Glasser
1fd3b216d0 Remove engineProxy support
We recommend the use of apollo-engine-reporting and the other built-in features
of AS 2.0 rather than engineProxy. You can still use the apollo-engine npm
module manually with AS 2.0, or stay on AS 1.0.
2018-06-13 12:32:05 -07:00
Evans Hauser
ba31cf7a44
Integrations export their own ApolloServer (#1161)
* feat: ApolloServer is created and exported by all variants

* docs: add initial docs around exporting ApolloServer

* feat: export gql from integrations

* docs: change apollo-server examples to use express with registerServer

* server: remove registerExpressServer

* core, docs: comment functions, fix api reference, context creation more like middleware args

* docs: fix integrationed typo
2018-06-12 17:46:56 -07:00
Evans Hauser
311c927c83
docs: add information around setting up additional middleware in migration/api 2018-06-04 14:34:20 -07:00
Yihong
04d0322d0c apollo-server: Fix registerServer path argument (#1133)
* core: add test for context as async function

* core,express: add support and test of context as async function

* Update apollo-server.md

Fix style for `registerServer`.
2018-06-04 09:49:21 -07:00
unicodeveloper
c26affb990 add middleware example 2018-06-01 22:16:28 +01:00
unicodeveloper
31609b6853 Add usage option for middleware in api ref 2018-06-01 21:56:52 +01:00
Evans Hauser
7e172b038d docs: replace references to variants with integrations 2018-05-30 15:25:12 -07:00
Evans Hauser
a1084059c7
docs: add code snippet example to context api reference 2018-05-22 17:47:48 -07:00
Evans Hauser
5577f54577
docs: flesh out api documentation for apollo-server 2018-05-22 17:14:52 -07:00
Evans Hauser
1d58af3d28
docs: fix links in apollo-server and graphql-tools reference 2018-05-09 10:33:15 -07:00
Evans Hauser
fd39fba4f4
docs: correct title graphql-tools reference api and add introduction 2018-05-09 10:07:45 -07:00
Evans Hauser
75239b06a9
docs: initial graphql-tools api reference and point engine api reference at node sidecar 2018-05-08 18:49:50 -07:00
Evans Hauser
8e0aefa7db
docs: remove apollo-server html custom formatting and title quotes 2018-05-08 18:49:47 -07:00
unicodeveloper
9c89a180e0 Add registerServer method 2018-05-03 12:37:00 -07:00
Jesse Rosenberger
1ae3ce2dc7
Remove grave accents, which do not work for titles. 2018-04-27 17:02:33 +03:00
Jesse Rosenberger
dfa4f61940
Merge branch 'docs-overhaul' into abernix/docs/api 2018-04-27 17:02:11 +03:00
Jesse Rosenberger
02f5c467ac
Change apollo-engine title to be without grave accents. 2018-04-27 17:01:57 +03:00
Jesse Rosenberger
d2ec5bb6d5
Clarify that gql must be imported, per feedback from @peggyrayzis. 2018-04-27 16:55:04 +03:00
Jesse Rosenberger
198b109e20
Drop ApolloServer.prototype. per feedback from @peggyrayzis. 2018-04-27 16:51:57 +03:00
Jesse Rosenberger
9625c0a7e2
Merge branch 'docs-overhaul' into abernix/docs/api 2018-04-27 16:41:43 +03:00
Jesse Rosenberger
0482216a64
docs: API: Change "Apollo Engine" title to be apollo-engine. 2018-04-27 16:41:11 +03:00
Jesse Rosenberger
790ebbea7b
docs: API > apollo-server. 2018-04-26 22:37:14 +03:00
Jesse Rosenberger
32a83b3686
docs: Change GraphQL Subscriptions title to match package name for API. 2018-04-24 14:18:40 +03:00