Skip to content

Commit

Permalink
Use new API reference front matter and update some headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Barlow committed Aug 29, 2020
1 parent 03d6ad3 commit 089bd3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions docs/source/api/apollo-server.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "API Reference: apollo-server"
sidebar_title: apollo-server
api_reference: true
---

This API reference documents the exports from the `apollo-server` package.
Expand All @@ -11,7 +12,7 @@ The core of an Apollo Server implementation. For an example, see [Get started wi

### Methods

#### `constructor(options)`: <`ApolloServer`>
#### `constructor`

Returns an initialized `ApolloServer` instance.

Expand Down Expand Up @@ -488,13 +489,13 @@ Instructs Apollo Server to begin listening for requests.

> This method is provided only by the `apollo-server` package. If you're integrating with Node.js middleware via a different package (such as `apollo-server-express`, instead see [`applyMiddleware`](#applymiddleware).
### Parameters
##### Parameters

* `options`: <`Object`>

When using the `apollo-server` package, calling `listen` on an instantiated `ApolloServer` will start the server by passing the specified (optional) `options` to a Node.js [`http.Server`](https://nodejs.org/api/http.html#http_class_http_server). For a full reference of the supported `options`, see the [documentation for `net.Server.listen`](https://nodejs.org/api/net.html#net_server_listen_options_callback).

### Returns
##### Returns

`Promise` that resolves to an object containing the following properties:

Expand All @@ -506,7 +507,7 @@ Instructs Apollo Server to begin listening for requests.

The `applyMiddleware` method is provided by the `apollo-server-{integration}` packages that use middleware, such as hapi and express. This method connects `ApolloServer` to a specific HTTP framework.

### Parameters
##### Parameters

* `options`: <`Object`>

Expand All @@ -526,7 +527,7 @@ The `applyMiddleware` method is provided by the `apollo-server-{integration}` pa

Pass the body-parser options. False removes the body parser middleware and true uses the defaults.

### Usage
##### Usage

The `applyMiddleware` method from `apollo-server-express` registration of middleware as shown in the example below:

Expand Down Expand Up @@ -597,7 +598,7 @@ The `makeExecutableSchema` method is re-exported from apollo-server as a conveni
* `parseOptions` = {}
* `inheritResolversFromInterfaces` = false

## `addMockFunctionsToSchema(options)`
## `addMockFunctionsToSchema`

The `addMockFunctionsToSchema` method is re-exported from `apollo-server` as a convenience.

Expand Down Expand Up @@ -653,7 +654,7 @@ addMockFunctionsToSchema({

## `EngineReportingOptions`

These are the supported fields of the `engine` object you provide to the [`ApolloServer` constructor](#constructoroptions-apolloserver) to configure communication with [Apollo Studio](https://www.apollographql.com/docs/studio/).
These are the supported fields of the `engine` object you provide to the [`ApolloServer` constructor](#constructor) to configure communication with [Apollo Studio](https://www.apollographql.com/docs/studio/).

| Name | Type | Description |
|------|------|-------------|
Expand Down
2 changes: 1 addition & 1 deletion docs/source/data/resolvers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ Resolver functions take the following positional arguments, in order:

| Argument | Description |
|---|---|
| `parent` | <p>The return value of the resolver for this field's parent (i.e., the previous resolver in the [resolver chain](#resolver-chains)).</p><p>For resolvers of top-level fields with no parent (such as fields of `Query`), this value is obtained from the `rootValue` function passed to [Apollo Server's constructor](/api/apollo-server/#constructoroptions-apolloserver).</p> |
| `parent` | <p>The return value of the resolver for this field's parent (i.e., the previous resolver in the [resolver chain](#resolver-chains)).</p><p>For resolvers of top-level fields with no parent (such as fields of `Query`), this value is obtained from the `rootValue` function passed to [Apollo Server's constructor](/api/apollo-server/#constructor).</p> |
| `args` | <p>An object that contains all GraphQL arguments provided for this field.</p><p> For example, when executing `query{ user(id: "4") }`, the `args` object passed to the `user` resolver is `{ "id": "4" }`.</p> |
| `context` | <p>An object shared across all resolvers that are executing for a particular operation. Use this to share per-operation state, including authentication information, dataloader instances, and anything else to track across resolvers. </p><p>See [The `context` argument](#the-context-argument) for more information.</p> |
| `info` | <p>Contains information about the operation's execution state, including the field name, the path to the field from the root, and more. </p><p>Its core fields are listed in the [GraphQL.js source code](https://github.com/graphql/graphql-js/blob/master/src/type/definition.js#L917-L928), and it is extended with additional functionality by other modules, like [`apollo-cache-control`](https://github.com/apollographql/apollo-server/tree/570f548b887/packages/apollo-cache-control).</p> |
Expand Down

0 comments on commit 089bd3c

Please sign in to comment.