diff --git a/ROADMAP.md b/ROADMAP.md index d9b417ac323..fd4fe2dfdf8 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,6 +1,6 @@ # 🔮 Apollo Client Roadmap -**Last updated: 2024-04-15** +**Last updated: 2024-04-22** For up to date release notes, refer to the project's [Changelog](https://github.com/apollographql/apollo-client/blob/main/CHANGELOG.md). @@ -13,14 +13,13 @@ For up to date release notes, refer to the project's [Changelog](https://github. --- -## [3.10.0](https://github.com/apollographql/apollo-client/milestone/33) - April 18th, 2024 +## [3.10.0](https://github.com/apollographql/apollo-client/milestone/33) - April 24th, 2024 -- RC target: April 2nd, 2024 +- Core `watchFragment` API to provide `useFragment`-like functionality for non-React envs +- schema-driven testing utilities ## Upcoming features -- Core `watchFragment` API to provide `useFragment`-like functionality for non-React envs -- schema-driven testing utilities - Data masking - Introduce a suspenseful `useFragment` that will suspend when the data is not yet loaded - leaner client (under alternate entry point) diff --git a/docs/source/data/queries.mdx b/docs/source/data/queries.mdx index 6eb6326b81b..bd15ebf1a84 100644 --- a/docs/source/data/queries.mdx +++ b/docs/source/data/queries.mdx @@ -370,17 +370,17 @@ new ApolloClient({ options, // The original value of options.fetchPolicy, before nextFetchPolicy was // applied for the first time. - initialPolicy, + initialFetchPolicy, // The ObservableQuery associated with this client.watchQuery call. observable, } ) { // When variables change, the default behavior is to reset - // options.fetchPolicy to context.initialPolicy. If you omit this logic, + // options.fetchPolicy to context.initialFetchPolicy. If you omit this logic, // your nextFetchPolicy function can override this default behavior to // prevent options.fetchPolicy from changing in this case. if (reason === 'variables-changed') { - return initialPolicy; + return initialFetchPolicy; } if ( diff --git a/docs/source/development-testing/static-typing.md b/docs/source/development-testing/static-typing.md index 3d11003c0c3..96a5148550c 100644 --- a/docs/source/development-testing/static-typing.md +++ b/docs/source/development-testing/static-typing.md @@ -16,7 +16,7 @@ Below, we'll guide you through installing and configuring GraphQL Code Generator To get started using GraphQL Code Generator, begin by installing the following packages (using Yarn or NPM): ```bash -yarn add -D typescript @graphql-codegen/cli @graphql-codegen/client-preset @graphql-typed-document-node/core +yarn add -D typescript graphql @graphql-codegen/cli @graphql-codegen/client-preset @graphql-typed-document-node/core ``` Next, we'll create a configuration file for GraphQL Code Generator, named [`codegen.ts`](https://www.the-guild.dev/graphql/codegen/docs/config-reference/codegen-config), at the root of our project: diff --git a/docs/source/index.mdx b/docs/source/index.mdx index 4d4d59f2e68..6c6565888e1 100644 --- a/docs/source/index.mdx +++ b/docs/source/index.mdx @@ -4,29 +4,46 @@ title: Introduction to Apollo Client import { Link } from 'gatsby'; -**Apollo Client** is a comprehensive state management library for JavaScript that enables you to manage both local and remote data with GraphQL. Use it to fetch, cache, and modify application data, all while automatically updating your UI. +**Apollo Client** is a comprehensive state management library for JavaScript. It enables you to manage both local and remote data with GraphQL. Use it to fetch, cache, and modify application data, all while automatically updating your UI. Apollo Client helps you structure code in an economical, predictable, and declarative way that's consistent with modern development practices. The core `@apollo/client` library provides built-in integration with React, and the larger Apollo community maintains [integrations for other popular view layers](#community-integrations).

Get started!

-## Features +## Core features + +Some of Apollo Client's core capabilities include: - **Declarative data fetching:** Write a query and receive data without manually tracking loading states. +- **Normalized request and response caching:** Boost performance by responding almost immediately to queries with cached data. - **Excellent developer experience:** Enjoy helpful tooling for TypeScript, Chrome / Firefox devtools, and VS Code. -- **Designed for modern React:** Take advantage of the latest React features, such as hooks. -- **Incrementally adoptable:** Drop Apollo into any JavaScript app and incorporate it feature by feature. +- **Designed for modern React:** Take advantage of the latest React features, such as hooks and Suspense. +- **Incrementally adoptable:** Drop Apollo Client into any JavaScript app and incorporate it feature by feature. - **Universally compatible:** Use any build setup and any GraphQL API. - **Community driven:** Share knowledge with thousands of developers in the GraphQL community. +## GraphOS supported features + +Apollo Client works seamlessly with these GraphOS router supported features: + +- Receiving data for specific fields incrementally with the [`@defer` directive](/graphos/operations/defer) +- Real-time updates via [GraphQL subscriptions](/graphos/operations/subscriptions) +- Safelisting with [persisted queries](/graphos/operations/persisted-queries) + + + +Apollo Client also supports `@defer` and GraphQL subscription implementations outside of GraphOS. + + + ## Recommended docs After you [get started](./get-started/), check out the full Apollo Client documentation in the navigation on the left. diff --git a/src/core/__tests__/fetchPolicies.ts b/src/core/__tests__/fetchPolicies.ts index 6f1f1cac5e9..f5ed3743f4b 100644 --- a/src/core/__tests__/fetchPolicies.ts +++ b/src/core/__tests__/fetchPolicies.ts @@ -1274,7 +1274,7 @@ describe("nextFetchPolicy", () => { // The nextFetchPolicy function we provided always returnes cache-first, // even when context.reason is variables-changed (which by default - // resets the fetchPolicy to context.initialPolicy), so cache-first is + // resets the fetchPolicy to context.initialFetchPolicy), so cache-first is // still what we see here. expect(observable.options.fetchPolicy).toBe("cache-first"); } else if (count === 3) {