mirror of
https://github.com/vale981/apollo-server
synced 2025-03-05 09:41:40 -05:00
Remove unnecessary --save
flags from npm install
commands.
While it used to be required to pass the `--save` flag in order to actually write the dependency to the project's `package.json` file, this is no longer the case in recent versions of npm.
This commit is contained in:
parent
6d62d2428d
commit
a7597913d2
6 changed files with 12 additions and 12 deletions
|
@ -27,7 +27,7 @@ Apollo Server is super easy to set up. Just `npm install apollo-server-<integrat
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
|
||||||
Run `npm install --save apollo-server-<integration>` and you're good to go!
|
Run `npm install apollo-server-<integration>` and you're good to go!
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const { ApolloServer, gql } = require('apollo-server');
|
const { ApolloServer, gql } = require('apollo-server');
|
||||||
|
@ -82,7 +82,7 @@ server.listen().then(({ url }) => {
|
||||||
|
|
||||||
## Integrations
|
## Integrations
|
||||||
|
|
||||||
Often times, Apollo Server needs to be run with a particular integration. To start, run `npm install --save apollo-server-<integration>` where `apollo-server-<integration>` is one of the following:
|
Often times, Apollo Server needs to be run with a particular integration. To start, run `npm install apollo-server-<integration>` where `apollo-server-<integration>` is one of the following:
|
||||||
|
|
||||||
- `apollo-server-express`
|
- `apollo-server-express`
|
||||||
- `apollo-server-koa`
|
- `apollo-server-koa`
|
||||||
|
|
|
@ -15,11 +15,11 @@ We need to install two packages to use Apollo Server, and a third package when u
|
||||||
|
|
||||||
To install, run:
|
To install, run:
|
||||||
|
|
||||||
npm install --save apollo-server graphql
|
npm install 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:
|
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 graphql
|
npm install apollo-server-express graphql
|
||||||
|
|
||||||
|
|
||||||
<h2 id="creating">Creating a server</h2>
|
<h2 id="creating">Creating a server</h2>
|
||||||
|
|
|
@ -26,7 +26,7 @@ Here, we'll take the [graphql-type-json](https://github.com/taion/graphql-type-j
|
||||||
Add the `graphql-type-json` package to the project's dependencies :
|
Add the `graphql-type-json` package to the project's dependencies :
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ npm install --save graphql-type-json
|
$ npm install graphql-type-json
|
||||||
```
|
```
|
||||||
|
|
||||||
In code, require the type defined by in the npm package and use it :
|
In code, require the type defined by in the npm package and use it :
|
||||||
|
|
|
@ -46,7 +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:
|
Run the following command to install both of these dependencies and save them in the project:
|
||||||
|
|
||||||
npm install --save apollo-server graphql
|
npm install apollo-server graphql
|
||||||
|
|
||||||
In the next step, we'll use these dependencies to create a server which processes and responds to incoming GraphQL requests.
|
In the next step, we'll use these dependencies to create a server which processes and responds to incoming GraphQL requests.
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ Check out the following changes for Apollo Server 2.0.
|
||||||
|
|
||||||
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:
|
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 graphql
|
npm install apollo-server-express graphql
|
||||||
|
|
||||||
The changes are best shown by comparing the before and after of the application.
|
The changes are best shown by comparing the before and after of the application.
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ For these cases, it's possible to remove the existing `apollo-server-{integratio
|
||||||
|
|
||||||
npm uninstall --save apollo-server-express
|
npm uninstall --save apollo-server-express
|
||||||
|
|
||||||
npm install --save apollo-server graphql
|
npm install apollo-server graphql
|
||||||
|
|
||||||
An implementation with this pattern would look like:
|
An implementation with this pattern would look like:
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ handles incoming GraphQL requests via the default `/graphql` endpoint.
|
||||||
1) Package installation.
|
1) Package installation.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install --save micro apollo-server-micro graphql
|
npm install micro apollo-server-micro graphql
|
||||||
```
|
```
|
||||||
|
|
||||||
2) `index.js`
|
2) `index.js`
|
||||||
|
@ -66,7 +66,7 @@ microservice, using [`micro-cors`](https://github.com/possibilities/micro-cors):
|
||||||
1) Package installation.
|
1) Package installation.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install --save micro micro-cors apollo-server-micro graphql
|
npm install micro micro-cors apollo-server-micro graphql
|
||||||
```
|
```
|
||||||
|
|
||||||
2) `index.js`
|
2) `index.js`
|
||||||
|
@ -117,7 +117,7 @@ uses a custom GraphQL endpoint path:
|
||||||
1) Package installation.
|
1) Package installation.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install --save micro apollo-server-micro graphql
|
npm install micro apollo-server-micro graphql
|
||||||
```
|
```
|
||||||
|
|
||||||
2) `index.js`
|
2) `index.js`
|
||||||
|
@ -168,7 +168,7 @@ fully custom routing:
|
||||||
1) Package installation.
|
1) Package installation.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install --save micro microrouter apollo-server-micro graphql
|
npm install micro microrouter apollo-server-micro graphql
|
||||||
```
|
```
|
||||||
|
|
||||||
2) `index.js`
|
2) `index.js`
|
||||||
|
|
Loading…
Add table
Reference in a new issue