Update API reference docs for links: part 2 - #12822
Conversation
🦋 Changeset detectedLatest commit: d6a21a9 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
|
90ba396 to
ed28279
Compare
ea8dec5 to
8c6c6cd
Compare
201376e to
6e272c1
Compare
8c6c6cd to
d7582cc
Compare
d7582cc to
8e77dec
Compare
size-limit report 📦
|
8e77dec to
45b8661
Compare
|
!docs set-base-branch release-4.0 |
There was a problem hiding this comment.
Much of this doc really should live in another part of the docs site, but given our limited time, let's do that a different time.
| * return { | ||
| * // ... |
There was a problem hiding this comment.
I would show setting at least one property here.
| * return { | |
| * // ... | |
| * return { | |
| * credentials: "include", | |
| * // ... |
There was a problem hiding this comment.
I'm not 100% sure, but maybe it might even sense to show something with a bit of type safety here in case users cannot enhance their global operation type?
const link = new SetContextLink((prevContext, operation) => {
return {
credentials: "include",
} satisfies Partial<HttpLink.ContextOptions>;
});There was a problem hiding this comment.
I might go the simple route for now and revisit once I write up the TypeScript declaration merging section for context (hopefully later today 🙂). Ideally I can link to that in this doc block.
| * import { sha256 } from "crypto-hash"; | ||
| * | ||
| * const link = new PersistedQueryLink({ sha256 }); |
There was a problem hiding this comment.
We could show using the subtle crypto API that's both supported in the browser and node at this point:
https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest#basic_example
Co-authored-by: Lenz Weber-Tronic <lorenz.weber-tronic@apollographql.com>
No description provided.