Skip to content

Commit

Permalink
Update documentation links.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydenseric committed Oct 23, 2023
1 parent 6e1100e commit 0c4813f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

Types published in [`@types/apollo-upload-client`](https://npm.im/@types/apollo-upload-client) should no longer be used.

Projects must configure [TypeScript](https://typescriptlang.org) to use types from the ECMAScript modules that have a `// @ts-check` comment:
Projects must configure TypeScript to use types from the ECMAScript modules that have a `// @ts-check` comment:

- [`compilerOptions.allowJs`](https://www.typescriptlang.org/tsconfig#allowJs) should be `true`.
- [`compilerOptions.maxNodeModuleJsDepth`](https://www.typescriptlang.org/tsconfig#maxNodeModuleJsDepth) should be reasonably large, e.g. `10`.
Expand All @@ -74,7 +74,7 @@
- Reorganized the test file structure.
- In tests, for objects with the property `headers` that as of [`@apollo/client`](https://npm.im/@apollo/client) [v3.7.0](https://github.com/apollographql/apollo-client/releases/tag/v3.7.0) is a null-prototype object, use the assertion `deepEqual` instead of `deepStrictEqual`.
- Tweaked code for type safety.
- Updated documentation.
- Updated documentation, including link URLs.
- Removed the readme badges.

## 17.0.0
Expand Down
12 changes: 6 additions & 6 deletions createUploadLink.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ import isExtractableFile from "./isExtractableFile.mjs";

/**
* Creates a
* [terminating Apollo Link](https://apollographql.com/docs/react/api/link/introduction/#the-terminating-link)
* for [Apollo Client](https://apollographql.com/docs/react) that fetches a
* [terminating Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/#the-terminating-link)
* for [Apollo Client](https://www.apollographql.com/docs/react) that fetches a
* [GraphQL multipart request](https://github.com/jaydenseric/graphql-multipart-request-spec)
* if the GraphQL variables contain files (by default
* [`FileList`](https://developer.mozilla.org/en-US/docs/Web/API/FileList),
* [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File), or
* [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) instances),
* or else fetches a regular
* [GraphQL POST or GET request](https://apollographql.com/docs/apollo-server/requests)
* [GraphQL POST or GET request](https://www.apollographql.com/docs/apollo-server/workflow/requests)
* (depending on the config and GraphQL operation).
*
* Some of the options are similar to the
* [`createHttpLink` options](https://apollographql.com/docs/react/api/link/apollo-link-http/#httplink-constructor-options).
* [`createHttpLink` options](https://www.apollographql.com/docs/react/api/link/apollo-link-http/#httplink-constructor-options).
* @see [GraphQL multipart request spec](https://github.com/jaydenseric/graphql-multipart-request-spec).
* @param {object} options Options.
* @param {string} [options.uri] GraphQL endpoint URI. Defaults to `"/graphql"`.
Expand Down Expand Up @@ -58,7 +58,7 @@ import isExtractableFile from "./isExtractableFile.mjs";
* {@linkcode fetchOptions}.
* @param {boolean} [options.includeExtensions] Toggles sending `extensions`
* fields to the GraphQL server. Defaults to `false`.
* @returns A [terminating Apollo Link](https://apollographql.com/docs/react/api/link/introduction/#the-terminating-link).
* @returns A [terminating Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/#the-terminating-link).
* @example
* A basic Apollo Client setup:
*
Expand Down Expand Up @@ -105,7 +105,7 @@ export default function createUploadLink({
const {
// Apollo Studio client awareness `name` and `version` can be configured
// via `ApolloClient` constructor options:
// https://apollographql.com/docs/studio/client-awareness/#using-apollo-server-and-apollo-client
// https://www.apollographql.com/docs/graphos/metrics/client-awareness/#setup
clientAwareness: { name, version } = {},
headers,
} = context;
Expand Down
12 changes: 6 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# apollo-upload-client

A [terminating Apollo Link](https://apollographql.com/docs/react/api/link/introduction/#the-terminating-link) for [Apollo Client](https://apollographql.com/docs/react) that fetches a [GraphQL multipart request](https://github.com/jaydenseric/graphql-multipart-request-spec) if the GraphQL variables contain files (by default [`FileList`](https://developer.mozilla.org/en-US/docs/Web/API/FileList), [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File), or [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) instances), or else fetches a regular [GraphQL POST or GET request](https://apollographql.com/docs/apollo-server/requests) (depending on the config and GraphQL operation).
A [terminating Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/#the-terminating-link) for [Apollo Client](https://www.apollographql.com/docs/react) that fetches a [GraphQL multipart request](https://github.com/jaydenseric/graphql-multipart-request-spec) if the GraphQL variables contain files (by default [`FileList`](https://developer.mozilla.org/en-US/docs/Web/API/FileList), [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File), or [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) instances), or else fetches a regular [GraphQL POST or GET request](https://www.apollographql.com/docs/apollo-server/workflow/requests) (depending on the config and GraphQL operation).

- [Installation](#installation)
- [Examples](#examples)
Expand All @@ -11,19 +11,19 @@ A [terminating Apollo Link](https://apollographql.com/docs/react/api/link/introd

## Installation

To install with [npm](https://npmjs.com/get-npm), run:
To install with [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm), run:

```sh
npm install apollo-upload-client
```

Polyfill any required globals (see [_**Requirements**_](#requirements)) that are missing in your server and client environments.

Remove any `uri`, `credentials`, or `headers` options from the [`ApolloClient` constructor](https://apollographql.com/docs/react/api/core/ApolloClient/#the-apolloclient-constructor).
Remove any `uri`, `credentials`, or `headers` options from the [`ApolloClient` constructor](https://www.apollographql.com/docs/react/api/core/ApolloClient/#the-apolloclient-constructor).

[Apollo Client](https://apollographql.com/docs/react) can only have 1 [terminating Apollo Link](https://apollographql.com/docs/react/api/link/introduction/#the-terminating-link) that sends the GraphQL requests; if one such as [`HttpLink`](https://apollographql.com/docs/react/api/link/apollo-link-http) is already setup, remove it.
[Apollo Client](https://www.apollographql.com/docs/react) can only have 1 [terminating Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/#the-terminating-link) that sends the GraphQL requests; if one such as [`HttpLink`](https://www.apollographql.com/docs/react/api/link/apollo-link-http) is already setup, remove it.

Initialize the client with a [terminating Apollo Link](https://apollographql.com/docs/react/api/link/introduction/#the-terminating-link) using the function [`createUploadLink`](./createUploadLink.mjs).
Initialize the client with a [terminating Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/#the-terminating-link) using the function [`createUploadLink`](./createUploadLink.mjs).

Also ensure the GraphQL server implements the [GraphQL multipart request spec](https://github.com/jaydenseric/graphql-multipart-request-spec) and that uploads are handled correctly in resolvers.

Expand Down Expand Up @@ -128,7 +128,7 @@ Consider polyfilling:
- [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)
- [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData)

Projects must configure [TypeScript](https://typescriptlang.org) to use types from the ECMAScript modules that have a `// @ts-check` comment:
Projects must configure [TypeScript](https://www.typescriptlang.org) to use types from the ECMAScript modules that have a `// @ts-check` comment:

- [`compilerOptions.allowJs`](https://www.typescriptlang.org/tsconfig#allowJs) should be `true`.
- [`compilerOptions.maxNodeModuleJsDepth`](https://www.typescriptlang.org/tsconfig#maxNodeModuleJsDepth) should be reasonably large, e.g. `10`.
Expand Down

0 comments on commit 0c4813f

Please sign in to comment.