- Notifications
You must be signed in to change notification settings - Fork2.7k
ObservableQuery documentation updates#12759
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
changeset-botbot commentedJul 3, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
|
pkg-pr-newbot commentedJul 3, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
commit: |
github-actionsbot commentedJul 3, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
size-limit report 📦
|
@@ -1,6 +0,0 @@ | |||
import { useMDXComponents } from "@mdx-js/react"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
These files were not needed here anymore as they moved into the docs repo and have no functionality here
/** | ||
* This namespace contains simplified interface versions of existing, complicated, types in Apollo Client. | ||
* These interfaces are used in the documentation to provide a more readable | ||
* and understandable API reference. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Adding a new namespace for general documentation
@@ -53,113 +54,144 @@ import { useApolloClient } from "./useApolloClient.js"; | |||
import { useSyncExternalStore } from "./useSyncExternalStore.js"; | |||
export declare namespace useQuery { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
And some namespace nesting here:
useQuery.Base.Options
anduseQuery.Base.Result
are the parts ofuseQuery.Options
anduseQuery.Result
that can be expressed with an interfaceuseQuery.Options
anduseQuery.Result
stay as they are, but don't have the interfacey part inline, but pull in the base types defined directly next to themuseQuery.DocumentationTypes.Options
anduseQuery.DocumentationTypes.Result
are simplified versions of the types above (so no ternaries etc.) so they can be used for documentation purposes.
@@ -1865,6 +1865,69 @@ describe("ApolloClient", () => { | |||
await expect(stream).not.toEmitAnything(); | |||
}); | |||
it("`cache-only` reverts to an empty but successful result if data was previously there and suddenly went missing", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
A few things I was documenting had no test cases that tested the documented behaviour, so I added them.
apollo-librarianbot commentedJul 16, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Had a few suggestions, but great start to the changes!
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
partial: boolean; | ||
} | ||
export interface RxjsObservable<TData> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Can we perhaps make thisObservableQueryRxjsObservable
or something? I see thepipe
andsubscribe
types useApolloQueryResult
which is very specific whileRxjsObservable
can emit much more than just that type.
Just trying to think of a way to align those two 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is just a blueprint to pull thepipe
andsubscribe
methods out of for the docs. That said, I'll move it over intoObservableQuery
, into aObservableQuery.DocumentTypes
namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
That's great. Thank you!
🛠️ Docs preview building...The preview is currently being built. Build ID: 4848c548e4ff175086e9bbdd |
Co-authored-by: Jerel Miller <jerelmiller@gmail.com>
🛠️ Docs preview building...The preview is currently being built. Build ID: 9bb20ba46b324b447805ae31 |
🛠️ Docs preview building...The preview is currently being built. Build ID: 6f01d90ea2863ee5bd76d987 |
🛠️ Docs preview building...The preview is currently being built. Build ID: c457ec0d5b226c329bd7b3c5 |
9f9ed93
intorelease-4.0Uh oh!
There was an error while loading.Please reload this page.
Starting with these as they probably will cause the most required changes over in the docs base repo.