feat(codegen): bake isomorphic fetch into ORM client template (#754)#1025
Open
feat(codegen): bake isomorphic fetch into ORM client template (#754)#1025
Conversation
Generated SDKs now handle Node's *.localhost DNS and Host-header quirks out of the box, so no separate @constructive-io/node shim is required. The template resolves a default fetch at runtime: browsers/Deno/Bun use globalThis.fetch; Node wraps it with a node:http/node:https implementation that rewrites *.localhost hostnames to plain localhost (RFC 6761 — resolves on both IPv4 and IPv6 loopback) while preserving the original Host header so server-side subdomain routing keeps working. @constructive-io/node is now a thin deprecation shim over @constructive-io/sdk for backwards compatibility. Also ports the codegen enum-type collection fix so input types referenced only by ENUM arguments aren't dropped. Validated end-to-end against a live PostGraphile dev server: sign-in at auth.localhost:3000 returns a Bearer token that unlocks authenticated queries against api.localhost:3000 — all handled by the generated SDK's baked-in FetchAdapter with zero caller-side configuration. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
Author
|
Core fix — single file does all the work
Codegen enum-type collection fix (ported from earlier work)
Codegen regression tests
@constructive-io/node deprecation
Mechanically generated (~1688 lines, 9 files)
|
NorOldBurden
approved these changes
Apr 24, 2026
Contributor
Author
|
@pyramation if you don't mind, could you use the generated sdk (not the |
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.
Generated SDKs now handle Node's *.localhost DNS and Host-header quirks out of the box, so no separate @constructive-io/node shim is required. The template resolves a default fetch at runtime: browsers/Deno/Bun use globalThis.fetch; Node wraps it with a node:http/node:https implementation that rewrites *.localhost hostnames to plain localhost (RFC 6761 — resolves on both IPv4 and IPv6 loopback) while preserving the original Host header so server-side subdomain routing keeps working.
@constructive-io/node is now a thin deprecation shim over @constructive-io/sdk for backwards compatibility. Also ports the codegen enum-type collection fix so input types referenced only by ENUM arguments aren't dropped.
Validated end-to-end against a live PostGraphile dev server: sign-in at auth.localhost:3000 returns a Bearer token that unlocks authenticated queries against api.localhost:3000 — all handled by the generated SDK's baked-in FetchAdapter with zero caller-side configuration.