Skip to content

Commit

Permalink
Merge branch 'master' into plugins-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nwalters512 committed Nov 15, 2019
2 parents 01464df + 8bf0a25 commit 29f2c67
Show file tree
Hide file tree
Showing 85 changed files with 2,708 additions and 3,731 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,18 @@ The version headers in this history reflect the versions of Apollo Server itself

> The changes noted within this `vNEXT` section have not been released yet. New PRs and commits which introduce changes should include an entry in this `vNEXT` section as part of their development. When a release is being prepared, a new header will be (manually) created below and the the appropriate changes within that release will be moved into the new section.
### v2.9.9

> [See complete versioning details.](https://github.com/apollographql/apollo-server/commit/93002737d53dd9a50b473ab9cef14849b3e539aa)
- `apollo-server-core`: Don't try parsing `variables` and `extensions` as JSON if they are defined but empty strings. [PR #3501](https://github.com/apollographql/apollo-server/pull/3501)
- `apollo-server-lambda`: Introduce `onHealthCheck` on `createHandler` in the same fashion as implemented in other integrations. [PR #3458](https://github.com/apollographql/apollo-server/pull/3458)
- `apollo-server-core`: Use `graphql`'s `isSchema` to more defensively check the user-specified schema's type at runtime and prevent unexpected errors. [PR #3462](https://github.com/apollographql/apollo-server/pull/3462)

### v2.9.8

> [See complete versioning details.](https://github.com/apollographql/apollo-server/commit/3cdde1b7a71ace6411fbacf82a1a61bf737444a6)
- `apollo-server-core`: Provide accurate type for `formatResponse` rather than generic `Function` type. [PR #3431](https://github.com/apollographql/apollo-server/pull/3431)
- `apollo-server-core`: Pass complete request context to `formatResponse`, rather than just `context`. [PR #3431](https://github.com/apollographql/apollo-server/pull/3431)

Expand Down
3,934 changes: 1,157 additions & 2,777 deletions docs/package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/package.json
Expand Up @@ -6,9 +6,9 @@
"serve": "gatsby serve"
},
"dependencies": {
"gatsby": "2.17.8",
"gatsby-theme-apollo-docs": "2.4.0",
"react": "16.10.2",
"react-dom": "16.10.2"
"gatsby": "2.17.11",
"gatsby-theme-apollo-docs": "3.0.1",
"react": "16.11.0",
"react-dom": "16.11.0"
}
}
4 changes: 2 additions & 2 deletions docs/source/data/subscriptions.md
Expand Up @@ -53,12 +53,12 @@ const resolvers = {
},
},
Query: {
posts(root: any, args: any, context: any) {
posts(root, args, context) {
return postController.posts();
},
},
Mutation: {
addPost(root: any, args: any, context: any) {
addPost(root, args, context) {
pubsub.publish(POST_ADDED, { postAdded: args });
return postController.addPost(args);
},
Expand Down
4 changes: 4 additions & 0 deletions docs/source/features/schema-stitching.md
Expand Up @@ -125,6 +125,10 @@ const authorSchema = makeExecutableSchema({

addMockFunctionsToSchema({ schema: authorSchema });

const schema = mergeSchemas({
schemas: [chirpSchema, authorSchema],
});

const server = new ApolloServer({ schema });

server.listen().then(({ url }) => {
Expand Down
10 changes: 8 additions & 2 deletions docs/source/federation/errors.md
Expand Up @@ -32,13 +32,19 @@ Apollo Federation implements a strict composition model. When building a gateway

- `REQUIRES_FIELDS_MISSING_EXTERNAL`: For every field in a `@requires` selection, there must be a matching `@external` field in the service.
- `REQUIRES_FIELDS_MISSING_ON_BASE`: The fields arg in `@requires` can only reference fields on the base type.
- `REQUIRES_USED_ON_BASE`: The requires directive may not be used on fields defined on a base type.
- `REQUIRES_USED_ON_BASE`: The requires directive can not be used on fields defined on a base type.

### Custom directives

- `EXECUTABLE_DIRECTIVES_ONLY`: Custom directives can only be [`ExecutableDirective`s](https://graphql.github.io/graphql-spec/June2018/#ExecutableDirectiveLocation). The locations that a directive implements must be a subset of: `QUERY`, `MUTATION`, `SUBSCRIPTION`, `FIELD`, `FRAGMENT_DEFINITION`, `FRAGMENT_SPREAD`, and `INLINE_FRAGMENT`.
- `EXECUTABLE_DIRECTIVES_IN_ALL_SERVICES`: Custom directives must be implemented across all services. It's acceptable to implement a directive as a no-op within a particular service, but it must still be defined.
- `EXECUTABLE_DIRECTIVES_IDENTICAL`: Custom directives must be implemented identically across all services. This means that arguments and their respective types, as well as the directive's locations, must all be identical within every service.

### Enums and Scalars

- `DUPLICATE_ENUM_DEFINITION`: An Enum was defined multiple times in a single service. Remove one of the definitions.
- `DUPLICATE_SCALAR_DEFINITION`: A Scalar was defined multiple times in a single service. Remove one of the definitions.
- `DUPLICATE_ENUM_VALUE`: A service has multiple definitions of the same Enum `value`. This duplicate value may be in the definition itself or enum extensions.
- `DUPLICATE_ENUM_VALUE`: A service has multiple definitions of the same Enum `value`. This duplicate value can be in the definition itself or enum extensions.
- `ENUM_MISMATCH`: An Enum does not have identical values across all services. Even if a service does not use all enum values, they still must be provided if another service uses them. This error will list services with matching definitions like `[serviceA, serviceB], [serviceC]` where `serviceA` and `serviceB` have matching enum definitions, and `serviceC` does not match the other definitions.
- `ENUM_MISMATCH_TYPE`: Enums must not use the name of a type in another service. For example, if a service defines an enum of `Category`, all definitions of `Category` in other services must also be enums.

Expand Down
11 changes: 11 additions & 0 deletions docs/source/federation/implementing.md
Expand Up @@ -359,6 +359,17 @@ server.listen().then(({ url }) => {

To learn more about `buildService` and `RemoteGraphQLDataSource`, see the [API docs](/api/apollo-gateway/).

## Implementing custom directives

> Note: Apollo Server does not currently support executable directives, however they are supported by the gateway.
The gateway currently provides limited support for custom, service-level directives. To use this feature, there are a few requirements that must be met in order to compose a valid graph:

* Directives can only implement executable locations. Executable directive locations are documented in the [spec](https://graphql.github.io/graphql-spec/June2018/#ExecutableDirectiveLocation).
> The following locations are considered valid to the gateway: QUERY, MUTATION, SUBSCRIPTION, FIELD, FRAGMENT\_DEFINITION, FRAGMENT\_SPREAD, INLINE\_FRAGMENT
* Directives must be implemented by *every* service that's part of the graph. It's acceptable for a service to do nothing with a particular directive, but a directive definition must exist within every service's schema.
* Directive definitions must be identical across all services. A directive definition is identical if its name, arguments and their types, and locations are all the same.

## Managing a federated graph

With Apollo Federation, teams are able to move quickly as they build out their GraphQL services. However, distributed systems introduce complexities which require special tooling and coordination across teams to safely rollout changes. The [Apollo Graph Manager](https://engine.apollographql.com) provides solutions to problems like schema change validation, graph update coordination, and metrics collection. For more information on the value of Graph Manager, read our [article on managed federation](https://www.apollographql.com/docs/graph-manager/federation/).
11 changes: 6 additions & 5 deletions docs/source/index.mdx
Expand Up @@ -18,10 +18,11 @@ Apollo Server implements a spec-compliant GraphQL server which can be queried fr

These docs will help you go from getting started with Apollo to becoming an expert in no time!

import {ButtonWrapper, ButtonLink} from 'gatsby-theme-apollo-docs';
import {Button} from '@apollo/space-kit/Button';
import {Link} from 'gatsby';

<ButtonWrapper>
<ButtonLink size="large" to="/getting-started/">
<div align="center">
<Button as={<Link to="/getting-started/" />} size="large">
Get started
</ButtonLink>
</ButtonWrapper>
</Button>
</div>
2 changes: 1 addition & 1 deletion docs/source/testing/mocking.md
Expand Up @@ -198,7 +198,7 @@ const { buildClientSchema } = require('graphql');
const introspectionResult = require('schema.json');
const { ApolloServer } = require('apollo-server');

const schema = buildClientSchema(introspectionResult);
const schema = buildClientSchema(introspectionResult.data);

const server = new ApolloServer({
schema,
Expand Down

0 comments on commit 29f2c67

Please sign in to comment.