Docs: Remove all RC references in Apollo Server 2 documentation (#1377)

* Remove rc from getting-started

* Remove rc from migration engine

* Remove RC references from migration 2 dot

* Remove rc references

* Remove RC references and correct spellings

* Remove RC references from Essentials

* Remove all RC references
This commit is contained in:
Prosper Otemuyiwa 2018-07-19 20:44:02 +01:00 committed by Evans Hauser
parent b3c80f3b2e
commit ca35b9fe1c
8 changed files with 34 additions and 37 deletions

View file

@ -4,7 +4,7 @@ title: Building a server
> Estimated time: About 8 minutes.
Apollo Server provides an easy way for new, or existing, applications to get running quickly. Existing applications can take advantage of middleware and new applications can utilize an integrated web-server. Both of these servers can be configured with minimal configuration and follow industry best-practices.
Apollo Server provides an easy way for new, or existing, applications to get running quickly. Existing applications can take advantage of middleware and new applications can utilize an integrated web server. Both of these servers can be configured with minimal configuration and follow industry best practices.
<h2 id="installation">Installation</h2>
@ -15,13 +15,12 @@ We need to install two packages to use Apollo Server, and a third package when u
To install, run:
npm install --save apollo-server@rc graphql
npm install --save apollo-server graphql
When adding Apollo Server to an existing application, a corresponding HTTP server support package needs to be installed as well. For example, for Express this is:
npm install --save apollo-server-express@rc graphql
npm install --save apollo-server-express graphql
> Note: During the release candidate period, it's necessary to use the `rc` npm package, as shown in the above commands.
<h2 id="creating">Creating a server</h2>
@ -85,7 +84,7 @@ At this point, if the message isn't printed to the console, it's possible that s
<h3 id="running">GraphQL Playground</h3>
To explore the newly created GraphQL server, open a browser to the link shown in the console, http://localhost:4000/graphql. Apollo Server sets up GraphQL Playground for you so that you can start running queries and exploring schemas quickly.
To explore the newly created GraphQL server, open a browser to the link shown in the console, `http://localhost:4000/graphql`. Apollo Server sets up GraphQL Playground for you so that you can start running queries and exploring schemas quickly.
To run a query, copy the following query and then press the "▶️" button:
@ -105,7 +104,7 @@ And the server should return a simple response:
}
```
Your server itself is hosted at http://localhost:4000/graphql. This would be the endpoint you pass to set up Apollo Client.
Your server itself is hosted at `http://localhost:4000/graphql`. This would be the endpoint you pass to set up Apollo Client.
<h2 id="integrations">Server integrations</h2>
@ -117,7 +116,7 @@ Existing applications generally already have middleware in place and Apollo Serv
> The existing application is frequently already named `app`, especially when using Express. If the application is identified by a different variable, pass the existing variable in place of `app`.
The following code uses the `apollo-server-express` package, which can be installed with `npm install apollo-server-express@rc`.
The following code uses the `apollo-server-express` package, which can be installed with `npm install apollo-server-express`.
```js
const { ApolloServer, gql } = require('apollo-server-express');
@ -138,7 +137,7 @@ app.listen({ port: 4000 }, () =>
Hapi follows the same pattern with `apollo-server-express` replaced with `apollo-server-hapi` and `app` replaced with Hapi server. `applyMiddleware` registers plugins, so it should be called with `await`.
> When transition from `apollo-server` to an integration package, running `npm uninstall apollo-server` will remove the extra dependency.
> When transitioning from `apollo-server` to an integration package, running`npm uninstall apollo-server` will remove the extra dependency.
<h3 id="serverless">Serverless</h3>

View file

@ -170,4 +170,4 @@ server.listen().then(({ url }) => {
## API
Under the hood, Apollo Sever uses a library for building GraphQL servers, called `graphql-tools`. The mocking functionality is provided by the function [`addMockFunctionsToSchema`](../api/graphql-tools.html#addMockFunctionsToSchema). The `mocks` object is passed directly to the function and `preserveResolvers` is always true. [`MockList`](../api/graphql-tools.html#MockList) is exported directly from the `graphql-tools` library.
Under the hood, Apollo Server uses a library for building GraphQL servers, called `graphql-tools`. The mocking functionality is provided by the function [`addMockFunctionsToSchema`](../api/graphql-tools.html#addMockFunctionsToSchema). The `mocks` object is passed directly to the function and `preserveResolvers` is always true. [`MockList`](../api/graphql-tools.html#MockList) is exported directly from the `graphql-tools` library.

View file

@ -158,4 +158,4 @@ Delegation preserves aliases that are passed from the parent query. However that
## API
Under the hood, Apollo server uses the `graphql-tools` library, which includes [`delegateToSchema`](../api/graphql-tools.html#delegateToSchema) by default.
Under the hood, Apollo Server uses the `graphql-tools` library, which includes [`delegateToSchema`](../api/graphql-tools.html#delegateToSchema) by default.

View file

@ -46,9 +46,7 @@ While you could write all of the necessary code yourself, these two dependencies
Run the following command to install both of these dependencies and save them in the project:
npm install --save apollo-server@rc graphql
> Important: While `apollo-server` is a release candidate, its necessary to install from the `rc` tag.
npm install --save apollo-server graphql
In the next step, we'll use these dependencies to create a server which processes and responds to incoming GraphQL requests.

View file

@ -1,6 +1,6 @@
---
title: Using Engine with v2.0 RC
description: How to use Engine with Apollo Server 2.0 RC
title: Using Engine with v2.0
description: How to use Engine with Apollo Server 2.0
---
Apollo Server provides reporting, persisted queries, and cache-control headers in native javascript by default, so often times moving to Apollo Server 2 without the Engine proxy is possible. For services that already contain the Engine proxy and depend on its full response caching, Apollo Server continues to support it with first class functionality. With Apollo Server 2, the Engine proxy can be started by the same node process. If the Engine proxy is running in a dedicated machine, Apollo Server 2 supports the cache-control and tracing extensions, used to communicate with the proxy.

View file

@ -1,13 +1,11 @@
---
title: Migrating to v2.0 Release Candidate
description: How to migrate to Apollo Server 2.0 rc
title: Migrating to v2.0
description: How to migrate to Apollo Server 2.0
---
The Apollo Server 2.0 release candidate dramatically simplifies the API for building a GraphQL server without compromising on features. It's also completely backward compatible, so you don't have to worry about breaking changes when upgrading.
Apollo Server 2.0 dramatically simplifies the API for building a GraphQL server without compromising on features. It's also completely backward compatible, so you don't have to worry about breaking changes when upgrading.
While it's possible to migrate an existing server to the 2.0 release candidate without any changes, we recommend changing to new patterns we're suggesting in order to take advantage of all the latest Apollo Server features, reduce the boilerplate, and enable future flexibility. To learn how to migrate to the 2.0 release candidate from version 1.0, please read the following guide.
> **Note:** In the release candidate of Apollo Server 2.0 only Express and Hapi are supported. Additional integrations will be implemented in the official 2.0 release.
While it's possible to migrate an existing server to 2.0 without any changes, we recommend changing to new patterns we're suggesting in order to take advantage of all the latest Apollo Server features, reduce the boilerplate, and enable future flexibility. To learn how to migrate to the 2.0 from version 1.0, please read the following guide.
<h2 id="gql-tag">The `gql` tag</h2>
@ -34,7 +32,7 @@ const typeDefs = gql(fs.readFileSync(__dirname.concat('/schema.graphql'), 'utf8'
<h2 id="app-deps">Changes to app dependencies</h2>
> Apollo Server 2.0 RC requires Node.js v6 and higher.
> Apollo Server 2.0 requires Node.js v6 and higher.
Apollo Server 2.0 simplifies implementing a GraphQL server. Apollo Server 1.0 revolved around providing middleware-based solutions, which had to be added to an application which already existed. These middleware implementations were tied to the HTTP server in use (e.g. `apollo-server-express` for Express implementations, `apollo-server-hapi` for hapi, etc.).
@ -45,7 +43,7 @@ There is a consideration to be made when following the rest of the guide:
<h2 id="simple-use">Simplified usage</h2>
Check out the following changes for Apollo Server 2.0 RC.
Check out the following changes for Apollo Server 2.0.
* You no longer need to import `body-parser` to set up `apollo-server-express`.
* You no longer need to import `makeExecutableSchema` from `graphql-tools`.
@ -55,9 +53,9 @@ Check out the following changes for Apollo Server 2.0 RC.
<h2 id="Middleware">Middleware</h2>
With the middleware option used by Apollo Server 1.0 users, it is necessary to install the release candidate version of `apollo-server-express`. To do this, use the `rc` tag when installing:
With the middleware option used by Apollo Server 1.0 users, it is necessary to install the 2.0 version of `apollo-server-express`. To do this, install via the terminal:
npm install --save apollo-server-express@rc graphql
npm install --save apollo-server-express graphql
The changes are best shown by comparing the before and after of the application.
@ -106,6 +104,8 @@ Now, you can just do this instead:
const express = require('express');
const { ApolloServer, gql } = require('apollo-server-express');
const PORT = 4000;
const app = express();
const typeDefs = gql`
@ -123,7 +123,7 @@ const resolvers = {
const server = new ApolloServer({ typeDefs, resolvers });
server.applyMiddleware({ app });
app.listen({ port: 4000 }, () =>
app.listen({ port: PORT }, () =>
console.log(`🚀 Server ready at http://localhost:4000${server.graphqlPath}`)
)
```
@ -132,11 +132,11 @@ app.listen({ port: 4000 }, () =>
For starting a production-ready GraphQL server quickly, Apollo Server 2.0 ships with a built-in server, so starting a server (e.g. Express, Koa, etc.) is no longer necessary.
For these cases, it's possible to remove the existing `apollo-server-{integrations}` package and add the new `apollo-server` release candidate. If using Express, this can be done by running:
For these cases, it's possible to remove the existing `apollo-server-{integrations}` package and add the new version 2.0 of `apollo-server`. If using Express, this can be done by running:
npm uninstall --save apollo-server-express
npm install --save apollo-server@rc graphql
npm install --save apollo-server graphql
An implementation with this pattern would look like:

View file

@ -2,7 +2,7 @@
title: What's new?
---
This section of the Apollo Server docs is an announcement page where it is easy to find and share big changes to the ApolloServer package, or the Apollo server side ecosystem. For a more detailed list of changes, check out the [Changelog](https://github.com/apollographql/apollo-server/blob/version-2/CHANGELOG.md). To upgrade from Apollo Server 1, please follow the [migration guide](./migration-two-dot.html)
This section of the Apollo Server docs is an announcement page where it is easy to find and share big changes to the `apollo-server` package, or the Apollo server side ecosystem. For a more detailed list of changes, check out the [Changelog](https://github.com/apollographql/apollo-server/blob/version-2/CHANGELOG.md). To upgrade from Apollo Server 1, please follow the [migration guide](./migration-two-dot.html)
## 2.0
@ -69,9 +69,9 @@ server.listen().then(({ url }) => {
});
```
## CDN Integration ([guide](https://www.apollographql.com/docs/guides/performance.html#CDN-Integration))
## CDN Integration ([guide](https://www.apollographql.com/docs/guides/performance.html#cdn))
Apollo Server works well with a Content-Distribution Network to cache full GraphQL query results. Apollo Server provides `cache-control` headers that a CDN uses to determine how long a request should be cached. For subsequent requests, the result will be served directly from the CDN's cache. A CDN paired with Apollo Server's persisted queries is especially powerful, since GraphQL operations can be shortened and sent with a HTTP GET request. To enable caching and a CDN in Apollo Server, follow the [Performance Guide](https://www.apollographql.com/docs/guides/performance.html#CDN-Integration).
Apollo Server works well with a Content-Distribution Network to cache full GraphQL query results. Apollo Server provides `cache-control` headers that a CDN uses to determine how long a request should be cached. For subsequent requests, the result will be served directly from the CDN's cache. A CDN paired with Apollo Server's persisted queries is especially powerful, since GraphQL operations can be shortened and sent with a HTTP GET request. To enable caching and a CDN in Apollo Server, follow the [Performance Guide](https://www.apollographql.com/docs/guides/performance.html#cdn).
## [Apollo Errors](./features/errors.html)
@ -176,7 +176,7 @@ server.listen().then(({ url }) => {
## [GraphQL Playground](./features/playground.html)
Apollo Server 2.0 creates a single GraphQL endpoint that provides data and a gui explorer depending on how the endpoint is accessed. In browser, Apollo Server returns GraphQL playground. For other cases, Apollo server returns the data for GraphQL requests from other clients, such as Apollo Client, curl, Postman, or Insomnia.
Apollo Server 2.0 creates a single GraphQL endpoint that provides data and a gui explorer depending on how the endpoint is accessed. In browser, Apollo Server returns GraphQL playground. For other cases, Apollo Server returns the data for GraphQL requests from other clients, such as Apollo Client, curl, Postman, or Insomnia.
```js
const { ApolloServer, gql } = require('apollo-server');
@ -203,7 +203,7 @@ server.listen().then(({ url }) => {
});
```
To start production mode, set the NODE_ENV environment variables to `production`. The Apollo Server constructor accepts `introspection` as a boolean, which can overwrite the default for the environment.
To start production mode, set the `NODE_ENV` environment variables to `production`. The Apollo Server constructor accepts `introspection` as a boolean, which can overwrite the default for the environment.
## File Uploads
@ -309,7 +309,7 @@ setInterval(
## Health Checks
The default Apollo server provides a health check endpoint at `/.well-known/apollo/server-health` that returns a 200 status code by default. If `onHealthCheck` is defined, the promise returned from the callback determines the status code. A successful resolution causes a 200 and rejection causes a 503. Health checks are often used by load balancers to determine if a server is available.
The default Apollo Server provides a health check endpoint at `/.well-known/apollo/server-health` that returns a 200 status code by default. If `onHealthCheck` is defined, the promise returned from the callback determines the status code. A successful resolution causes a 200 and rejection causes a 503. Health checks are often used by load balancers to determine if a server is available.
```js
const { ApolloServer, gql } = require('apollo-server');

View file

@ -55,6 +55,6 @@ Learning and implementing a new way to manage your data can be scary and risky.
Companies ranging from enterprise to startups trust Apollo Server to power their most critical applications. If you'd like to learn more about how transitioning to GraphQL And Apollo improved their engineer's workflows and improved their products, check out these case studies:
[Implementing GraphQL at Major League Soccer](https://labs.mlssoccer.com/implementing-graphql-at-major-league-soccer-ff0a002b20ca)
[The New York Times Now on Apollo](https://open.nytimes.com/the-new-york-times-now-on-apollo-b9a78a5038c)
[The New York Times Now on Apollo](https://open.nytimes.com/the-new-york-times-now-on-apollo-b9a78a5038c).
If your company is using Apollo Server in production, we'd love to feature a case study on the Apollo blog! Please get in touch via Slack so we can learn more about how you're using Apollo. Alternatively, if you already have a blog post or a conference talk that you'd like to feature here, please send a [Pull Request](https://github.com/apollographql/apollo-server/pulls)
If your company is using Apollo Server in production, we'd love to feature a case study on the Apollo blog! Please get in touch via Slack so we can learn more about how you're using Apollo. Alternatively, if you already have a blog post or a conference talk that you'd like to feature here, please send a [Pull Request](https://github.com/apollographql/apollo-server/pulls).