Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a new pull request by comparing changes across two branches #462

Merged
merged 35 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b19f492
Fixed pages for replatform
BlenderDude Aug 9, 2024
a890f84
refactor out single use component
BlenderDude Aug 9, 2024
64c5c8c
remove errors page
BlenderDude Aug 9, 2024
2c73868
Merge pull request #12012 from BlenderDude/main-docs-replatform
shorgi Aug 20, 2024
95cd6e5
fix links
shorgi Aug 20, 2024
1015a4a
fix links
shorgi Aug 21, 2024
98caa35
fix links
shorgi Aug 27, 2024
38b6d80
Update ROADMAP.md
jerelmiller Sep 9, 2024
a31af05
docs(community-links): add printer link (#12060)
egorlem Sep 10, 2024
73a8af6
add pkg.pr.new to publish pr releases (#12061)
phryneas Sep 13, 2024
559dcc8
chore(deps): update cimg/node docker tag to v22.8.0 (#12031)
renovate[bot] Sep 16, 2024
54fa525
chore(deps): update slackapi/slack-github-action action to v1.27.0 (#…
renovate[bot] Sep 16, 2024
5b3c1e9
Update ROADMAP.md
jerelmiller Sep 16, 2024
94f5e50
Update ROADMAP.md
jerelmiller Sep 23, 2024
6b9c713
chore(deps): update cimg/node docker tag to v22.9.0
renovate[bot] Sep 25, 2024
6c5bfeb
Merge pull request #12070 from apollographql/renovate/cimg-node-22.x
jerelmiller Sep 25, 2024
aba626e
Update api extractor to latest (#12077)
jerelmiller Sep 25, 2024
abf7463
Make it clearer that fetchMore variables merge is a shallow merge in …
jerelmiller Oct 1, 2024
aeb28c5
Remove Summit callouts
Meschreiber Oct 2, 2024
5642559
Remove empty file
Meschreiber Oct 2, 2024
a29a409
Cleanup
Meschreiber Oct 2, 2024
d172ac3
Merge pull request #12084 from apollographql/ms/docs-cleanup
Meschreiber Oct 2, 2024
c064a20
Merge branch 'main' into main-docs-replatform
Meschreiber Oct 3, 2024
8047181
2024-10-07 Roadmap update
bignimbus Oct 7, 2024
6b33767
Merge branch 'main' into main-docs-replatform
Meschreiber Oct 15, 2024
491e2f9
Remove docs-publish workflow
Meschreiber Oct 16, 2024
5b3a6cf
Merge pull request #12095 from apollographql/main-docs-replatform
Meschreiber Oct 16, 2024
6e70bd9
use external `@testing-library/react-render-stream` (#12090)
phryneas Oct 16, 2024
6496b25
Update ROADMAP.md
jerelmiller Oct 21, 2024
f36b938
Update ROADMAP.md
jerelmiller Nov 4, 2024
a3f95c6
Fix Suspense boundary indefinitely shown when fetchMore returns error…
jerelmiller Nov 7, 2024
33a1dae
`ObservableStream` use `ReadableStream` instead of iterator (#12112)
phryneas Nov 7, 2024
16516e5
Version Packages (#12111)
github-actions[bot] Nov 7, 2024
2676338
chore(deps): update cimg/node docker tag to v23 (#12099)
renovate[bot] Nov 7, 2024
014b6aa
Bump rollup from 2.79.1 to 2.79.2 (#12081)
dependabot[bot] Nov 7, 2024
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
19 changes: 0 additions & 19 deletions .github/workflows/docs-publish.yml

This file was deleted.

6 changes: 3 additions & 3 deletions docs/source/api/link/apollo-link-remove-typename.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ minVersion: 3.8.0

## Overview

When reusing data from a query as an argument to another GraphQL operation, `__typename` fields can cause errors. To avoid this, you can use the `removeTypenameFromVariables` link to automatically remove `__typename` fields from variables in operations.
When reusing data from a query as an argument to another GraphQL operation, `__typename` fields can cause errors. To avoid this, you can use the `removeTypenameFromVariables` link to automatically remove `__typename` fields from variables in operations.

## Remove `__typename` from all variables

Expand Down Expand Up @@ -78,8 +78,8 @@ const client = new ApolloClient({
});
```

If you're using [directional composition](./link/introduction#directional-composition),
for example, to [send a subscription to a websocket connection](../data/subscriptions#3-split-communication-by-operation-recommended),
If you're using [directional composition](/react/api/link/introduction#directional-composition),
for example, to [send a subscription to a websocket connection](/react/data/subscriptions#3-split-communication-by-operation-recommended),
place `removeTypenameLink` before `splitLink` to remove `__typename` from variables for all operations.

```ts
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/link/persisted-queries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Using persisted queries for safelisting has the following requirements:
- The [`@apollo/generate-persisted-query-manifest` package](https://www.npmjs.com/package/@apollo/generate-persisted-query-manifest)
- The [`@apollo/persisted-query-lists` package](https://www.npmjs.com/package/@apollo/persisted-query-lists)
- [GraphOS Router](/router) (v1.25.0+)
- [GraphOS Enterprise plan](/graphos/enterprise/)
- [GraphOS Enterprise plan](https://www.apollographql.com/pricing)

You can use APQ with the following versions of Apollo Client Web, Apollo Server, and Apollo Router Core:
- Apollo Client Web (v3.2.0+)
Expand Down
2 changes: 0 additions & 2 deletions docs/source/api/react/components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,3 @@ The Subscription component accepts the following props. Only `subscription` is *
### Render prop function

<PropertySignatureTable canonicalReference="@apollo/client!SubscriptionResult:interface" idPrefix="subscriptionresult-interface" />

<SubscriptionResult3 />
184 changes: 106 additions & 78 deletions docs/source/api/react/hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import UseSuspenseQueryResult from '../../../shared/useSuspenseQuery-result.mdx'
import UseBackgroundQueryResult from '../../../shared/useBackgroundQuery-result.mdx';
import UseReadQueryResult from '../../../shared/useReadQuery-result.mdx';
import { FunctionDetails, PropertySignatureTable, ManualTuple, InterfaceDetails } from '../../../shared/ApiDoc';
import { UseLoadableQueryResult } from '../../../shared/Overrides/UseLoadableQueryResult'

## The `ApolloProvider` component

Expand Down Expand Up @@ -73,85 +72,77 @@ function WithApolloClient() {

<FunctionDetails canonicalReference="@apollo/client!useQuery:function(1)" headingLevel={2} />

<FunctionDetails canonicalReference="@apollo/client!useLazyQuery:function(1)" headingLevel={2}
result={<div>
<pre><code class="language-ts">
[execute: LazyQueryExecFunction&lt;TData, TVariables&gt;, result: QueryResult&lt;TData, TVariables&gt;]
</code></pre>

A tuple of two values:

<ManualTuple idPrefix="uselazyquery-result" elements={[
{
name: "execute",
type: "(options?: LazyQueryHookOptions<TVariables>) => Promise<LazyQueryResult<TData, TVariables>>",
description: "Function that can be triggered to execute the suspended query. After being called, `useLazyQuery` behaves just like `useQuery`. The `useLazyQuery` function returns a promise that fulfills with a query result when the query succeeds or fails."
},
{
name: "result",
type: "QueryResult<TData, TVariables>",
description: "The result of the query. See the `useQuery` hook for more details.",
canonicalReference: "@apollo/client!QueryResult:interface"
}
]}/>
</div>}
/>
<FunctionDetails canonicalReference="@apollo/client!useLazyQuery:function(1)" headingLevel={2}>
```ts
[execute: LazyQueryExecFunction<TData, TVariables>, result: QueryResult<TData, TVariables>]
```

A tuple of two values:

<ManualTuple>
<ManualTupleItem
name="execute"
type="(options?: LazyQueryHookOptions<TVariables>) => Promise<LazyQueryResult<TData, TVariables>>"
>
Function that can be triggered to execute the suspended query. After being called, `useLazyQuery` behaves just like `useQuery`. The `useLazyQuery` function returns a promise that fulfills with a query result when the query succeeds or fails.
</ManualTupleItem>
<ManualTupleItem
name="result"
type="QueryResult<TData, TVariables>"
canonicalReference="@apollo/client!QueryResult:interface"
>
The result of the query. See the `useQuery` hook for more details.
</ManualTupleItem>
</ManualTuple>
</FunctionDetails>

<FunctionDetails
canonicalReference="@apollo/client!useMutation:function(1)"
headingLevel={2}
result={
<div>
<pre>
<code class="language-ts">
{`[
mutate: (options?: MutationFunctionOptions<TData, TVariables>) => Promise<FetchResult<TData>>,
result: MutationResult<TData>
]`}
</code>
</pre>
A tuple of two values:
<ManualTuple
idPrefix="usemutation-result"
elements={[
{
name: "mutate",
type: `(
options?: MutationFunctionOptions<TData, TVariables>
) => Promise<FetchResult<TData>>`,
description: <div>
A function to trigger the mutation from your UI. You can optionally pass this function any of the following options:

<ul>
<li><code>awaitRefetchQueries</code></li>
<li><code>context</code></li>
<li><code>fetchPolicy</code></li>
<li><code>onCompleted</code></li>
<li><code>onError</code></li>
<li><code>optimisticResponse</code></li>
<li><code>refetchQueries</code></li>
<li><code>onQueryUpdated</code></li>
<li><code>update</code></li>
<li><code>variables</code></li>
<li><code>client</code></li>
</ul>

Any option you pass here overrides any existing value for that option that you passed to <code>useMutation</code>.

The mutate function returns a promise that fulfills with your mutation result.
</div>,
},
{
name: "result",
type: "MutationResult<TData>",
description: "The result of the mutation.",
canonicalReference: "@apollo/client!MutationResult:interface",
},
]}
/>
</div>
}
/>
>
```ts
[
mutate: (options?: MutationFunctionOptions<TData, TVariables>) => Promise<FetchResult<TData>>,
result: MutationResult<TData>
]
```
A tuple of two values:
<ManualTuple>
<ManualTupleItem
name="mutate"
type={`(
options?: MutationFunctionOptions<TData, TVariables>
) => Promise<FetchResult<TData>>`}
idPrefix="usemutation-result"
>
A function to trigger the mutation from your UI. You can optionally pass this function any of the following options:

- `awaitRefetchQueries`
- `context`
- `fetchPolicy`
- `onCompleted`
- `onError`
- `optimisticResponse`
- `refetchQueries`
- `onQueryUpdated`
- `update`
- `variables`
- `client`

Any option you pass here overrides any existing value for that option that you passed to `useMutation`.

The mutate function returns a promise that fulfills with your mutation result.
</ManualTupleItem>
<ManualTupleItem
name="result"
type="MutationResult<TData>"
canonicalReference="@apollo/client!MutationResult:interface"
idPrefix="usemutation-result"
>
The result of the mutation.
</ManualTupleItem>
</ManualTuple>
</FunctionDetails>

<FunctionDetails canonicalReference="@apollo/client!useSubscription:function(1)" headingLevel={2} />

Expand Down Expand Up @@ -411,8 +402,45 @@ function useReadQuery<TData>(
<FunctionDetails
canonicalReference="@apollo/client!useLoadableQuery:function(5)"
headingLevel={2}
result={<UseLoadableQueryResult />}
/>
>
```ts
[
loadQuery: LoadQueryFunction<TVariables>,
queryRef: QueryRef<TData, TVariables> | null,
{
fetchMore: FetchMoreFunction<TData, TVariables>;
refetch: RefetchFunction<TData, TVariables>;
reset: ResetFunction;
}
]
```

A tuple of three values:
<ManualTuple>
<ManualTupleItem
idPrefix="useloadablequery-result"
name="loadQuery"
type="LoadQueryFunction<TVariables>"
>
A function used to imperatively load a query. Calling this function will create or update the `queryRef` returned by `useLoadableQuery`, which should be passed to `useReadQuery`.
</ManualTupleItem>
<ManualTupleItem
idPrefix="useloadablequery-result"
name="queryRef"
type="QueryRef<TData, TVariables> | null"
canonicalReference="@apollo/client!QueryRef:interface"
>
The `queryRef` used by `useReadQuery` to read the query result.
</ManualTupleItem>
<ManualTupleItem
idPrefix="useloadablequery-result"
name="handlers"
type="{ fetchMore: FetchMoreFunction<TData, TVariables>; refetch: RefetchFunction<TData, TVariables>; reset: ResetFunction; }"
>
Additional handlers used for the query, such as `refetch`.
</ManualTupleItem>
</ManualTuple>
</FunctionDetails>

<FunctionDetails canonicalReference="@apollo/client!useQueryRefHandlers:function(1)" headingLevel={2} />

Expand Down
2 changes: 1 addition & 1 deletion docs/source/caching/cache-configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ This example shows a variety of `typePolicies` with different `keyFields`:

If an object has multiple `keyFields`, the cache ID always lists those fields in the same order to ensure uniqueness.

Note that these `keyFields` strings always refer to the canonical field names defined in the schema. This means that ID computation is _not_ sensitive to [field aliases](/resources/graphql-glossary/#alias).
Note that these `keyFields` strings always refer to the canonical field names defined in the schema. This means that ID computation is _not_ sensitive to field aliases.

### Calculating an object's cache ID

Expand Down
8 changes: 4 additions & 4 deletions docs/source/data/operation-best-practices.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ You should define a name for _every_ GraphQL operation in your application. Doin
* You clarify the purpose of each operation for both yourself and your teammates.
* You avoid unexpected errors when combining multiple operations in a single query document (an anonymous operation can only appear alone).
* You improve debugging output in both client _and_ server code, helping you identify exactly which operation is causing issues.
* [Apollo Studio](/studio/) provides helpful operation-level metrics, which require named operations.
* [Apollo GraphOS Studio](/graphos/graphs/studio-features) provides helpful operation-level metrics, which require named operations.

## Use GraphQL variables to provide arguments

Expand Down Expand Up @@ -94,7 +94,7 @@ The server-side cache also powers features like [automatic persisted queries](/a

The value of a GraphQL argument might include sensitive information, such as an access token or a user's personal info. If this information is included in a query string, it's cached with the rest of that query string.

Variable values are _not_ included in query strings. You can also specify _which_ variable values (if any) are [included in metrics reporting](/apollo-server/api/plugin/usage-reporting/#sendvariablevalues) to Apollo Studio.
Variable values are _not_ included in query strings. You can also specify _which_ variable values (if any) are [included in metrics reporting](/apollo-server/api/plugin/usage-reporting/#sendvariablevalues) to Studio.

## Query only the data you need, where you need it

Expand Down Expand Up @@ -193,7 +193,7 @@ To improve the performance of your [server-side response cache](/apollo-server/p

## Set your app's `name` and `version` for metrics reporting (paid)

> This recommendation is _most_ pertinent to Apollo Studio organizations with a [paid plan](https://www.apollographql.com/pricing/), however it can be helpful for all apps.
> This recommendation is _most_ pertinent to Studio organizations with a [paid plan](https://www.apollographql.com/pricing/), however it can be helpful for all apps.

The constructor of `ApolloClient` accepts the `name` and `version` options:

Expand All @@ -208,4 +208,4 @@ const client = new ApolloClient({

If you specify these values, Apollo Client automatically adds them to each operation request as HTTP headers (`apollographql-client-name` and `apollographql-client-version`).

Then if you've configured [metrics reporting in Apollo Studio](/graphos/metrics/usage-reporting/), Apollo Server includes your app's `name` and `version` in the operation traces it reports to Studio. This enables you to [segment metrics by client](/graphos/metrics/client-awareness/).
Then if you've configured metrics reporting in Studio, Apollo Server includes your app's `name` and `version` in the operation traces it reports to Studio. This enables you to [segment metrics by client](/graphos/metrics/client-awareness/).
36 changes: 0 additions & 36 deletions docs/source/errors.mdx

This file was deleted.

26 changes: 13 additions & 13 deletions docs/source/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Apollo Client helps you structure code in an economical, predictable, and declar
<p>
<ButtonLink
size="lg"
href="./get-started/"
href="/react/get-started/"
colorScheme="navy"
>
Get started!
Expand Down Expand Up @@ -44,29 +44,29 @@ Apollo Client also supports `@defer` and GraphQL subscription implementations ou

## Recommended docs

After you [get started](./get-started/), check out the full Apollo Client documentation in the navigation on the left.
After you [get started](/react/get-started/), check out the full Apollo Client documentation in the navigation on the left.

We recommend the following articles in particular:

* **[Queries](./data/queries/) and [Mutations](./data/mutations/)**. These are the read and write operations of GraphQL.
* [**Caching overview**](./caching/overview/). Apollo Client's normalized cache enables you to skip network requests entirely when data is already available locally.
* [**Managing local state**](./local-state/local-state-management/). Apollo Client provides APIs for managing both remote and local data, enabling you to consolidate all of your application's state.
* [**Basic HTTP networking**](./networking/basic-http-networking/). Learn how to send custom headers and other authentication metadata in your queries.
* [**Testing React components**](./development-testing/testing/). Test your GraphQL operations without requiring a connection to a server.
* **[Queries](/react/data/queries/) and [Mutations](/react/data/mutations/)**. These are the read and write operations of GraphQL.
* [**Caching overview**](/react/caching/overview/). Apollo Client's normalized cache enables you to skip network requests entirely when data is already available locally.
* [**Managing local state**](/react/local-state/local-state-management/). Apollo Client provides APIs for managing both remote and local data, enabling you to consolidate all of your application's state.
* [**Basic HTTP networking**](/react/networking/basic-http-networking/). Learn how to send custom headers and other authentication metadata in your queries.
* [**Testing React components**](/react/development-testing/testing/). Test your GraphQL operations without requiring a connection to a server.

## Community integrations

This documentation set focuses on React, but Apollo Client supports many other libraries and languages:

- JavaScript
- [Angular](integrations/integrations/#angular)
- [Vue](integrations/integrations/#vue)
- [Svelte](integrations/integrations/#svelte)
- [Solid.js](integrations/integrations/#solidjs)
- [Ember](integrations/integrations/#ember)
- [Angular](/react/integrations/integrations/#angular)
- [Vue](/react/integrations/integrations/#vue)
- [Svelte](/react/integrations/integrations/#svelte)
- [Solid.js](/react/integrations/integrations/#solidjs)
- [Ember](/react/integrations/integrations/#ember)
- [Meteor](https://www.meteor.com) (thanks to [DDP-Apollo](https://github.com/Swydo/ddp-apollo))
- Web Components
- [Apollo Elements](integrations/integrations/#web-components)
- [Apollo Elements](/react/integrations/integrations/#web-components)
- Native mobile
- [Native iOS with Swift](/ios)
- [Native Android with Java and Kotlin](/kotlin)
Loading