这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import GithubLink from '../src/GithubLink.js'

Apollo gives a neat abstraction layer and an interface to your GraphQL server. You don't need to worry about constructing your queries with request body, headers and options, that you might have done with `AFNetworking` or `NWConnection` say. You can directly write queries and mutations in GraphQL and they will automatically be sent to your server via your apollo client instance.

Let's get started by installing apollo client framework & peer graphql dependenices:
Let's get started by installing apollo client framework & peer graphql dependencies:

- Add github `"apollostack/apollo-ios"` to your Cartfile.
- Run `carthage update`
Expand Down Expand Up @@ -159,4 +159,4 @@ class NetworkManager {

}

```
```
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ This is one of the key-reasons that makes GraphQL a joy to work with!

- **Avoid over-fetching**: You avoid fetching more data than you need because you
can specify the exact **fields** you need.
- **Prevent multipe API calls**: In case you need more data, you can also avoid
- **Prevent multiple API calls**: In case you need more data, you can also avoid
making multiple calls to your API. In the case above, you don't need to make
2 API calls to fetch `user` and `address` separately.
- **Lesser communication with API developers**: Sometimes to fetch the exact data
you need, especially if you need to fetch more data and want to avoid multipe API
you need, especially if you need to fetch more data and want to avoid multiple API
calls, you will need to ask your API developers to build a new API. With GraphQL,
your work is *independent* of the API team! This allows you to work faster on your
app.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ query {

## Adding parameters (arguments) to GraphQL queries

In most API calls, you usually use paramters. For example, to specify what data you're fetching.
In most API calls, you usually use parameters. For example, to specify what data you're fetching.
If you're familiar with making `GET` calls, you would have used a query parameter. For example,
to fetch only 10 todos you might have made this API call: `GET /api/todos?limit=10`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import YoutubeEmbed from "../src/YoutubeEmbed.js";

Apollo gives a neat abstraction layer and an interface to your GraphQL server. You don't need to worry about constructing your queries with request body, headers and options, that you might have done with `axios` or `fetch` say. You can directly write queries and mutations in GraphQL and they will automatically be sent to your server via your apollo client instance.

Let's get started by installing apollo client & peer graphql dependenices:
Let's get started by installing apollo client & peer graphql dependencies:

```bash
$ npm install --save apollo-client react-apollo apollo-cache-inmemory apollo-link-http graphql graphql-tag
Expand Down Expand Up @@ -58,7 +58,7 @@ const App = ({auth}) => {
export default App;
```

These are the required apollo dependenices to get started. Now let's define a function which will return apollo client with httplink and cache.
These are the required apollo dependencies to get started. Now let's define a function which will return apollo client with httplink and cache.

```javascript
import ApolloClient from 'apollo-client';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ This is one of the key-reasons that makes GraphQL a joy to work with!

- **Avoid over-fetching**: You avoid fetching more data than you need because you
can specify the exact **fields** you need.
- **Prevent multipe API calls**: In case you need more data, you can also avoid
- **Prevent multiple API calls**: In case you need more data, you can also avoid
making multiple calls to your API. In the case above, you don't need to make
2 API calls to fetch `user` and `address` separately.
- **Lesser communication with API developers**: Sometimes to fetch the exact data
you need, especially if you need to fetch more data and want to avoid multipe API
you need, especially if you need to fetch more data and want to avoid multiple API
calls, you will need to ask your API developers to build a new API. With GraphQL,
your work is *independent* of the API team! This allows you to work faster on your
app.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ and their profile information (which is just their name for now):

## Adding parameters (arguments) to GraphQL queries

In most API calls, you usually use paramters. For example, to specify what data you're fetching.
In most API calls, you usually use parameters. For example, to specify what data you're fetching.
If you're familiar with making `GET` calls, you would have used a query parameter. For example,
to fetch only 10 todos you might have made this API call: `GET /api/todos?limit=10`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import YoutubeEmbed from "../../src/YoutubeEmbed.js";

<YoutubeEmbed link="https://www.youtube.com/embed/yZmVWeyoW_4" />

When we had initially set up Apollo, we used Apollo Boost to install the required dependenices. But subscriptions is an advanced use case which Apollo Boost does not support. So we have to install more dependenices to set up subscriptions.
When we had initially set up Apollo, we used Apollo Boost to install the required dependencies. But subscriptions is an advanced use case which Apollo Boost does not support. So we have to install more dependencies to set up subscriptions.

```bash
+ $ npm install apollo-link-ws subscriptions-transport-ws --save
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import GithubLink from "../src/GithubLink.js";

Apollo gives a neat abstraction layer and an interface to your GraphQL server. You don't need to worry about constructing your queries with request body, headers and options, that you might have done with `axios` or `fetch` say. You can directly write queries and mutations in GraphQL and they will automatically be sent to your server via your apollo client instance.

Let's get started by installing apollo client & peer graphql dependenices:
Let's get started by installing apollo client & peer graphql dependencies:

```bash
$ npm install --save apollo-client react-apollo apollo-cache-inmemory apollo-link-http graphql graphql-tag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ This is one of the key-reasons that makes GraphQL a joy to work with!

- **Avoid over-fetching**: You avoid fetching more data than you need because you
can specify the exact **fields** you need.
- **Prevent multipe API calls**: In case you need more data, you can also avoid
- **Prevent multiple API calls**: In case you need more data, you can also avoid
making multiple calls to your API. In the case above, you don't need to make
2 API calls to fetch `user` and `address` separately.
- **Lesser communication with API developers**: Sometimes to fetch the exact data
you need, especially if you need to fetch more data and want to avoid multipe API
you need, especially if you need to fetch more data and want to avoid multiple API
calls, you will need to ask your API developers to build a new API. With GraphQL,
your work is *independent* of the API team! This allows you to work faster on your
app.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ and their profile information (which is just their name for now):

## Adding parameters (arguments) to GraphQL queries

In most API calls, you usually use paramters. For example, to specify what data you're fetching.
In most API calls, you usually use parameters. For example, to specify what data you're fetching.
If you're familiar with making `GET` calls, you would have used a query parameter. For example,
to fetch only 10 todos you might have made this API calls: `GET /api/todos?limit=10`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "Subscription"

import GithubLink from "../../src/GithubLink.js";

When we had initially set up Apollo, we used Apollo Boost to install the required dependenices. But subscriptions is an advanced use case which Apollo Boost does not support. So we have to install more dependenices to set up subscriptions.
When we had initially set up Apollo, we used Apollo Boost to install the required dependencies. But subscriptions is an advanced use case which Apollo Boost does not support. So we have to install more dependencies to set up subscriptions.

```bash
+ $ npm install apollo-link-ws subscriptions-transport-ws --save
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import YoutubeEmbed from "../src/YoutubeEmbed.js";

Apollo gives a neat abstraction layer and an interface to your GraphQL server. You don't need to worry about constructing your queries with request body, headers and options, that you might have done with `axios` or `fetch` say. You can directly write queries and mutations in GraphQL and they will automatically be sent to your server via your apollo client instance.

Let's get started by installing apollo client & peer graphql dependenices:
Let's get started by installing apollo client & peer graphql dependencies:

```bash
$ npm install --save vue-apollo graphql apollo-client apollo-link-http apollo-cache-inmemory graphql-tag
Expand Down Expand Up @@ -64,7 +64,7 @@ Open `src/main.js` and add the following code to create an ApolloClient instance

```

These are the required apollo dependenices to get started. We have also written a simple utility to get token information to construct the headers.
These are the required apollo dependencies to get started. We have also written a simple utility to get token information to construct the headers.

## Install VueApollo Plugin

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ This is one of the key-reasons that makes GraphQL a joy to work with!

- **Avoid over-fetching**: You avoid fetching more data than you need because you
can specify the exact **fields** you need.
- **Prevent multipe API calls**: In case you need more data, you can also avoid
- **Prevent multiple API calls**: In case you need more data, you can also avoid
making multiple calls to your API. In the case above, you don't need to make
2 API calls to fetch `user` and `address` separately.
- **Lesser communication with API developers**: Sometimes to fetch the exact data
you need, especially if you need to fetch more data and want to avoid multipe API
you need, especially if you need to fetch more data and want to avoid multiple API
calls, you will need to ask your API developers to build a new API. With GraphQL,
your work is *independent* of the API team! This allows you to work faster on your
app.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ and their profile information (which is just their name for now):

## Adding parameters (arguments) to GraphQL queries

In most API calls, you usually use paramters. For example, to specify what data you're fetching.
In most API calls, you usually use parameters. For example, to specify what data you're fetching.
If you're familiar with making `GET` calls, you would have used a query parameter. For example,
to fetch only 10 todos you might have made this API calls: `GET /api/todos?limit=10`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import YoutubeEmbed from "../../src/YoutubeEmbed.js";

<YoutubeEmbed link="https://www.youtube.com/embed/ZujdsxSRt48" />

When we had initially set up Apollo, we used Apollo Boost to install the required dependenices. But subscriptions is an advanced use case which Apollo Boost does not support. So we have to install more dependenices to set up subscriptions.
When we had initially set up Apollo, we used Apollo Boost to install the required dependencies. But subscriptions is an advanced use case which Apollo Boost does not support. So we have to install more dependencies to set up subscriptions.

```bash
npm install apollo-link-ws subscriptions-transport-ws --save
Expand Down