feat(sdk): support typed documents in http adapters#1566
Merged
Conversation
🦋 Changeset detectedLatest commit: b2851ac The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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: |
This comment has been minimized.
This comment has been minimized.
dqn
force-pushed
the
feat/http-adapter-typed-document-node
branch
from
June 26, 2026 01:01
b78247a to
acd85bf
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
📖 Docs Quality & Consistency Check
✅ Docs are consistent with the implementation and contain no user-facing internal-detail leaks.
Checked areas:
- HTTP adapter documentation (
packages/sdk/docs/services/http-adapter.md) - new "Typed GraphQL Documents" section accurately describes the feature - HTTP adapter type definitions and JSDoc (
packages/sdk/src/configure/services/http-adapter/http-adapter.ts) - exported types and function documentation are user-focused - Changeset description (
.changeset/typed-http-adapter-documents.md) - concise and accurate - Implementation consistency - all documented features are correctly implemented:
TypedDocumentNodesupport inqueryfield- Type inference for variables (required vs optional)
- Type inference for
resp.datain output handlers - Union types for multiple method handlers
HttpAdapterInputFn<Query>generic type parameter
- Internal implementation details (bundler,
__normalizeHttpAdapterGraphQLRequest,@0no-co/graphql.webprinter) are correctly kept internal and not mentioned in user-facing documentation
Re-run this check by adding the
docs-checklabel to the PR.
toiroakr
reviewed
Jun 26, 2026
| return `import __adapter from ${JSON.stringify(absoluteSourcePath)}; | ||
| const documentNormalizer = `import { print as __printHttpAdapterDocument } from ${JSON.stringify(graphqlPrinterModule)}; | ||
| function __normalizeHttpAdapterGraphQLRequest(result) { | ||
| if (typeof result.query === "string") { |
Contributor
There was a problem hiding this comment.
If result is null or undefined, accessing result.query throws a TypeError.
Change the condition to if (!result || typeof result.query === "string").
Code Metrics Report (packages/sdk)
Details | | main (04c2ebb) | #1566 (af9f0fd) | +/- |
|--------------------|----------------|-----------------|-------|
+ | Coverage | 69.7% | 69.7% | +0.0% |
| Files | 422 | 422 | 0 |
| Lines | 15081 | 15086 | +5 |
+ | Covered | 10516 | 10521 | +5 |
- | Code to Test Ratio | 1:0.4 | 1:0.4 | -0.1 |
| Code | 102339 | 102424 | +85 |
+ | Test | 45593 | 45603 | +10 |Code coverage of files in pull request scope (91.8% → 92.3%)
SDK Configure Bundle Size
Runtime Performance
Type Performance (instantiations)
Reported by octocov |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
outputcallback receives typedresp.data.Example