Skip to content

refactor: remove NodeHttpAdapter in favor of @constructive-io/fetch#1152

Merged
pyramation merged 2 commits into
mainfrom
refactor/remove-node-http-adapter
May 13, 2026
Merged

refactor: remove NodeHttpAdapter in favor of @constructive-io/fetch#1152
pyramation merged 2 commits into
mainfrom
refactor/remove-node-http-adapter

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

@pyramation pyramation commented May 13, 2026

Summary

Remove the redundant NodeHttpAdapter (which used node:http/node:https directly) from codegen and all generated SDKs. The ORM's FetchAdapter already uses createFetch() from @constructive-io/fetch, which handles *.localhost DNS rewriting and Host header preservation in Node.js automatically.

What changed:

  • Deleted node-fetch.ts template and all 8 generated node-fetch.ts files
  • Removed generateNodeFetchFile() from codegen utils
  • Simplified executor generators to always use { endpoint, headers }FetchAdapter handles the rest
  • Fully removed nodeHttpAdapter option from ExecutorOptions, GenerateMultiTargetCliOptions, config types, and generateCreateClientFile
  • Removed all config plumbing from generate.ts
  • Updated all 4 SDK executor.ts files

External API unchanged — consumers still pass endpoint + headers to createClient.

Net: -1,766 lines.

Review & Testing Checklist for Human

  • Verify createClient({ endpoint, headers }) works with *.localhost endpoints (e.g. auth.localhost:3000/graphql) — FetchAdapter handles DNS + Host header via @constructive-io/fetch
  • Run cnc codegen on a project and confirm no node-fetch.ts files appear in cli/ or orm/ output
  • Confirm generated executor.ts uses { endpoint, headers } instead of new NodeHttpAdapter(...)
  • The graphql/orm-test suite (which runs codegen dynamically against a live PG) is the best integration test for this — it exercises runCodegenAndLoad end-to-end

Notes

  • Follow-up from PR #1026 review
  • The FindManyArgs template still has TOrderBy = never — can be a separate follow-up

Link to Devin session: https://app.devin.ai/sessions/7d04ac62fc67430aba0aaa40e044eb14
Requested by: @pyramation

The ORM client's FetchAdapter already uses createFetch() from
@constructive-io/fetch, which handles *.localhost DNS rewriting and
Host header preservation in Node.js. The separate NodeHttpAdapter
(using node:http/node:https directly) is redundant.

- Remove node-fetch.ts template and all generated node-fetch.ts files
- Remove generateNodeFetchFile() from utils-generator
- Simplify executor generators to always use { endpoint, headers }
- Remove nodeHttpAdapter config plumbing from generate.ts
- Deprecate nodeHttpAdapter option in config types
- Update all 4 SDK executor.ts files to use endpoint/headers

The external API (createClient, getClient) is unchanged — consumers
pass endpoint + headers, and FetchAdapter handles the rest.
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@pyramation pyramation merged commit 579af0c into main May 13, 2026
38 checks passed
@pyramation pyramation deleted the refactor/remove-node-http-adapter branch May 13, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant