From ba35f921991539ec83fd250e8b82e69558a756f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Evaldas=20Al=C4=8Dauskis?= Date: Tue, 25 Aug 2020 21:26:41 +0300 Subject: [PATCH 1/2] Update pagination.mdx (#6890) --- docs/source/data/pagination.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/data/pagination.mdx b/docs/source/data/pagination.mdx index bf3d87a0847..6f3d8fadf22 100644 --- a/docs/source/data/pagination.mdx +++ b/docs/source/data/pagination.mdx @@ -93,7 +93,7 @@ const MORE_COMMENTS_QUERY = gql` `; function CommentsWithData() { - const { data: { comments, cursor }, loading, fetchMore } = useQuery( + const { data: { moreComments: {comments, cursor} }, loading, fetchMore } = useQuery( MORE_COMMENTS_QUERY ); From 170fce0630c08fb61529ebe0118ead109d11de14 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Tue, 25 Aug 2020 14:49:06 -0400 Subject: [PATCH 2/2] Replace references to master branch with main. Part of the transition promised in #6774. --- CHANGELOG.md | 4 ++-- CONTRIBUTING.md | 3 --- docs/gatsby-config.js | 2 +- docs/source/data/fragments.md | 2 +- docs/source/data/queries.mdx | 2 +- docs/source/migrating/apollo-client-3-migration.md | 4 ++-- 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d7678d4670..269f5c095cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ ## Improvements -- Provide [jscodeshift](https://www.npmjs.com/package/jscodeshift) transform for automatically converting Apollo Client 2.x `import` declarations to use Apollo Client 3.x packages. [Instructions](https://github.com/apollographql/apollo-client/tree/master/codemods/ac2-to-ac3).
+- Provide [jscodeshift](https://www.npmjs.com/package/jscodeshift) transform for automatically converting Apollo Client 2.x `import` declarations to use Apollo Client 3.x packages. [Instructions](https://github.com/apollographql/apollo-client/tree/main/codemods/ac2-to-ac3).
[@dminkovsky](https://github.com/dminkovsky) and [@jcreighton](https://github.com/jcreighton) in [#6486](https://github.com/apollographql/apollo-client/pull/6486) ## Apollo Client 3.1.2 @@ -115,7 +115,7 @@ - The `updateQuery` function previously required by `fetchMore` has been deprecated with a warning, and will be removed in the next major version of Apollo Client. Please consider using a `merge` function to handle incoming data instead of relying on `updateQuery`.
[@benjamn](https://github.com/benjamn) in [#6464](https://github.com/apollographql/apollo-client/pull/6464) - - Helper functions for generating common pagination-related field policies may be imported from `@apollo/client/utilities`. The most basic helper is `concatPagination`, which emulates the concatenation behavior of typical `updateQuery` functions. A more sophisticated helper is `offsetLimitPagination`, which implements offset/limit-based pagination. If you are consuming paginated data from a Relay-friendly API, use `relayStylePagination`. Feel free to use [these helper functions](https://github.com/apollographql/apollo-client/blob/master/src/utilities/policies/pagination.ts) as inspiration for your own field policies, and/or modify them to suit your needs.
+ - Helper functions for generating common pagination-related field policies may be imported from `@apollo/client/utilities`. The most basic helper is `concatPagination`, which emulates the concatenation behavior of typical `updateQuery` functions. A more sophisticated helper is `offsetLimitPagination`, which implements offset/limit-based pagination. If you are consuming paginated data from a Relay-friendly API, use `relayStylePagination`. Feel free to use [these helper functions](https://github.com/apollographql/apollo-client/blob/main/src/utilities/policies/pagination.ts) as inspiration for your own field policies, and/or modify them to suit your needs.
[@benjamn](https://github.com/benjamn) in [#6465](https://github.com/apollographql/apollo-client/pull/6465) - Updated to work with `graphql@15`.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 053e3789ed8..7c84462d78d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -117,8 +117,6 @@ jest --config ./config/jest.config.js --testRegex __tests__/useQuery.test.tsx It can be useful to link an Apollo Client checkout into an application, to test how Apollo Client development changes impact a real app. We'll use the [Apollo fullstack tutorial application](https://github.com/apollographql/fullstack-tutorial) to demonstrate this. -> **Note:** The fullstack tutorial updates for Apollo Client 3 haven't been merged into `master` yet, so for now we'll use the tutorial's `apollo-client-3` branch. - 1) Clone and install Apollo Client. ``` @@ -135,7 +133,6 @@ cd .. ``` git clone https://github.com/apollographql/fullstack-tutorial.git cd fullstack-tutorial -git checkout apollo-client-3 cd final/server npm i cd ../client diff --git a/docs/gatsby-config.js b/docs/gatsby-config.js index f7509030d02..799a210f664 100644 --- a/docs/gatsby-config.js +++ b/docs/gatsby-config.js @@ -30,7 +30,7 @@ module.exports = { 'index', 'why-apollo', 'get-started', - '[Changelog](https://github.com/apollographql/apollo-client/blob/master/CHANGELOG.md)', + '[Changelog](https://github.com/apollographql/apollo-client/blob/main/CHANGELOG.md)', ], 'Fetching': [ 'data/queries', diff --git a/docs/source/data/fragments.md b/docs/source/data/fragments.md index f6ce655d3da..89225e75ae2 100644 --- a/docs/source/data/fragments.md +++ b/docs/source/data/fragments.md @@ -151,7 +151,7 @@ There's nothing special about the naming of `VoteButtons.fragments.entry` or `Re ### Importing fragments when using Webpack -When loading `.graphql` files with [graphql-tag/loader](https://github.com/apollographql/graphql-tag/blob/master/loader.js), we can include fragments using `import` statements. For example: +When loading `.graphql` files with [graphql-tag/loader](https://github.com/apollographql/graphql-tag/blob/main/loader.js), we can include fragments using `import` statements. For example: ```graphql #import "./someFragment.graphql" diff --git a/docs/source/data/queries.mdx b/docs/source/data/queries.mdx index a9d4c257493..739c3f438f3 100644 --- a/docs/source/data/queries.mdx +++ b/docs/source/data/queries.mdx @@ -202,7 +202,7 @@ function DogPhoto({ breed }) { } ``` -The `networkStatus` property is a `NetworkStatus` enum that represents different loading states. Refetch is represented by `NetworkStatus.refetch`, and there are also values for polling and pagination. For a full list of all the possible loading states, check out the [source](https://github.com/apollographql/apollo-client/blob/master/src/core/networkStatus.ts). +The `networkStatus` property is a `NetworkStatus` enum that represents different loading states. Refetch is represented by `NetworkStatus.refetch`, and there are also values for polling and pagination. For a full list of all the possible loading states, check out the [source](https://github.com/apollographql/apollo-client/blob/main/src/core/networkStatus.ts). ## Inspecting error states diff --git a/docs/source/migrating/apollo-client-3-migration.md b/docs/source/migrating/apollo-client-3-migration.md index e54721e396a..6095bc25741 100644 --- a/docs/source/migrating/apollo-client-3-migration.md +++ b/docs/source/migrating/apollo-client-3-migration.md @@ -12,11 +12,11 @@ To illustrate the migration process, we've also made this video that uses the ex * Apollo Client is now distributed as the `@apollo/client` package (previous versions are distributed as `apollo-client`). * The `@apollo/client` package includes both React hooks and GraphQL request handling, which previously required installing separate packages. * Apollo Client’s cache (`InMemoryCache`) is more flexible and performant. It now supports garbage collection, storage of both normalized and non-normalized data, and the customization of cached data with new `TypePolicy` and `FieldPolicy` APIs. -* The update also includes numerous bug fixes and optimizations, as described in the [changelog](https://github.com/apollographql/apollo-client/blob/master/CHANGELOG.md). +* The update also includes numerous bug fixes and optimizations, as described in the [changelog](https://github.com/apollographql/apollo-client/blob/main/CHANGELOG.md). ## Installation -> **WARNING:** Apollo Client 3.0 is a major-version release that includes **breaking changes**. If you are updating an existing application to use Apollo Client 3.0, please see the [changelog](https://github.com/apollographql/apollo-client/blob/master/CHANGELOG.md) for details about these changes. +> **WARNING:** Apollo Client 3.0 is a major-version release that includes **breaking changes**. If you are updating an existing application to use Apollo Client 3.0, please see the [changelog](https://github.com/apollographql/apollo-client/blob/main/CHANGELOG.md) for details about these changes. Install Apollo Client 3.0 with the following command: