apollo-link-http
Advanced tools
Comparing version 1.5.15 to 1.5.16
{ | ||
"name": "apollo-link-http", | ||
"version": "1.5.15", | ||
"version": "1.5.16", | ||
"description": "HTTP transport layer for GraphQL", | ||
@@ -38,4 +38,4 @@ "author": "Evans Hauser <evanshauser@gmail.com>", | ||
"dependencies": { | ||
"apollo-link": "^1.2.12", | ||
"apollo-link-http-common": "^0.2.14", | ||
"apollo-link": "^1.2.13", | ||
"apollo-link-http-common": "^0.2.15", | ||
"tslib": "^1.9.3" | ||
@@ -47,12 +47,12 @@ }, | ||
"devDependencies": { | ||
"@types/graphql": "14.2.0", | ||
"@types/jest": "24.0.14", | ||
"@types/graphql": "14.2.3", | ||
"@types/jest": "24.0.18", | ||
"apollo-fetch": "0.7.0", | ||
"fetch-mock": "6.5.2", | ||
"graphql": "14.3.1", | ||
"graphql": "14.5.4", | ||
"graphql-tag": "2.10.1", | ||
"jest": "24.8.0", | ||
"jest": "24.9.0", | ||
"object-to-querystring": "1.0.8", | ||
"rimraf": "2.6.3", | ||
"rollup": "1.15.4", | ||
"rimraf": "2.7.1", | ||
"rollup": "1.20.3", | ||
"ts-jest": "22.4.6", | ||
@@ -79,3 +79,3 @@ "tslint": "5.17.0", | ||
}, | ||
"gitHead": "f902ab977d7d173951528a0bc2e38521b2afc096" | ||
"gitHead": "74d412528dd474fc41ee0bf504e36e01d7e05e2b" | ||
} |
@@ -18,3 +18,3 @@ --- | ||
<h2 id="usage">Usage</h2> | ||
## Usage | ||
@@ -29,3 +29,3 @@ Import and initialize this link in just two lines: | ||
<h2 id="options">Options</h2> | ||
## Options | ||
@@ -42,7 +42,7 @@ HTTP Link takes an object with some options on it to customize the behavior of the link. If your server supports it, the HTTP link can also send over metadata about the request in the extensions field. To enable this, pass `includeExtensions` as true. The options you can pass are outlined below: | ||
<h2 id="fetch">Fetch polyfill</h2> | ||
## Fetch polyfill | ||
The HTTP Link relies on having `fetch` present in your runtime environment. If you are running on react-native, or modern browsers, this should be no problem. If you are targeting an environment without `fetch` such as older browsers or the server, you will need to pass your own `fetch` to the link through the options. We recommend [`unfetch`](https://github.com/developit/unfetch) for older browsers and [`node-fetch`](https://github.com/bitinn/node-fetch) for running in Node. | ||
<h2 id="context">Context</h2> | ||
## Context | ||
@@ -62,3 +62,3 @@ The Http Link uses the `headers` field on the context to allow passing headers to the HTTP request. It also supports the `credentials` field for defining credentials policy, `uri` for changing the endpoint dynamically, and `fetchOptions` to allow generic fetch overrides (i.e. `method: "GET"`). These options will override the same key if passed when creating the the link. | ||
<h3 id="persisted-queries">Persisted queries</h3> | ||
### Persisted queries | ||
@@ -83,3 +83,3 @@ The http link supports an advanced GraphQL feature called persisted queries. This allows you to not send the stringified query over the wire, but instead send some kind of identifier of the query. To support this you need to attach the id somewhere to the extensions field and pass the following options to the context: | ||
<h3 id="passing-context">Passing context per query</h3> | ||
### Passing context per query | ||
@@ -110,5 +110,5 @@ Apollo Client supports passing context separately for every query, so you can do things like pass a special header for a single query invocation if you need to. | ||
<h2 id="error">Errors</h2> | ||
## Errors | ||
The Http Link draws a distinction between client, server and GraphQL errors. Server errors can occur in three different scenarios: parse, network and data errors. [`apollo-link-error`](error.html) provides an [interface](error.html#Usage) for handling these errors. This list describes the scenarios that cause different errors: | ||
The Http Link draws a distinction between client, server and GraphQL errors. Server errors can occur in three different scenarios: parse, network and data errors. [`apollo-link-error`](error) provides an [interface](error#callback) for handling these errors. This list describes the scenarios that cause different errors: | ||
@@ -156,7 +156,7 @@ * _Client parse error_: the request body is not-serializable due to circular references for example | ||
<h2 id="custom">Custom fetching</h2> | ||
## Custom fetching | ||
You can use the `fetch` option when creating an http-link to do a lot of custom networking. This is useful if you want to modify the request based on the calculated headers or calculate the uri based on the operation: | ||
<h3 id="custom-auth">Custom auth</h3> | ||
### Custom auth | ||
@@ -177,3 +177,3 @@ ```js | ||
<h3 id="dynamic-uri">Dynamic URI</h3> | ||
### Dynamic URI | ||
@@ -189,3 +189,3 @@ ```js | ||
<h2 id="upgrading">Upgrade: Apollo Client 1.0</h2> | ||
## Upgrade: Apollo Client 1.0 | ||
@@ -192,0 +192,0 @@ If you previously used either `apollo-fetch` or `apollo-client`'s `createNetworkInterface`, you will need to change the way `use` and `useAfter` are implemented in your app. Both can be implemented by writing a custom link. It's important to note that regardless of whether you're adding middleware or afterware, your Http link will always be last in the chain since it's a terminating link. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
86397
Updatedapollo-link@^1.2.13