[PR #1018] [MERGED] feat(langgraph): add Zod support for state definition / config schema #1175

Closed
opened 2026-02-15 19:17:32 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraphjs/pull/1018
Author: @dqbd
Created: 3/21/2025
Status: Merged
Merged: 3/25/2025
Merged by: @dqbd

Base: mainHead: dqbd/zod


📝 Commits (5)

  • 3496a64 feat(langgraph): add Zod support for state definition / config schema
  • 2626354 Merge with StateGraph
  • b384f54 Use overloads to avoid TSC errors, use channels
  • 6778c98 Add update schema inference
  • 8f7a245 Cast as any for internal StateGraph

📊 Changes

7 files changed (+284 additions, -20 deletions)

View changed files

📝 libs/langgraph-swarm/src/swarm.ts (+2 -1)
📝 libs/langgraph/package.json (+7 -1)
📝 libs/langgraph/src/graph/state.ts (+75 -18)
libs/langgraph/src/graph/zod/schema.ts (+31 -0)
libs/langgraph/src/graph/zod/state.ts (+98 -0)
📝 libs/langgraph/src/tests/pregel.test.ts (+67 -0)
📝 yarn.lock (+4 -0)

📄 Description

This PR adds an alternative method of defining schema of an agent, with the primary goal having the ability to extract the schema of the graph in runtime, rather than relying on tsc

Follow-up PRs:


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langgraphjs/pull/1018 **Author:** [@dqbd](https://github.com/dqbd) **Created:** 3/21/2025 **Status:** ✅ Merged **Merged:** 3/25/2025 **Merged by:** [@dqbd](https://github.com/dqbd) **Base:** `main` ← **Head:** `dqbd/zod` --- ### 📝 Commits (5) - [`3496a64`](https://github.com/langchain-ai/langgraphjs/commit/3496a6417905715bfcad86baff9fedee4d19abc2) feat(langgraph): add Zod support for state definition / config schema - [`2626354`](https://github.com/langchain-ai/langgraphjs/commit/26263540efcaeab4289866c8162655be7030e758) Merge with StateGraph - [`b384f54`](https://github.com/langchain-ai/langgraphjs/commit/b384f54307d69fadc3e931637116abb6fc32543c) Use overloads to avoid TSC errors, use channels - [`6778c98`](https://github.com/langchain-ai/langgraphjs/commit/6778c98e7f03bfa8f2c684aa72323457d3b43bc0) Add update schema inference - [`8f7a245`](https://github.com/langchain-ai/langgraphjs/commit/8f7a24555a57fd46d0b6cf98d5d8206e3893252d) Cast as any for internal StateGraph ### 📊 Changes **7 files changed** (+284 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `libs/langgraph-swarm/src/swarm.ts` (+2 -1) 📝 `libs/langgraph/package.json` (+7 -1) 📝 `libs/langgraph/src/graph/state.ts` (+75 -18) ➕ `libs/langgraph/src/graph/zod/schema.ts` (+31 -0) ➕ `libs/langgraph/src/graph/zod/state.ts` (+98 -0) 📝 `libs/langgraph/src/tests/pregel.test.ts` (+67 -0) 📝 `yarn.lock` (+4 -0) </details> ### 📄 Description This PR adds an alternative method of defining schema of an agent, with the primary goal having the ability to extract the schema of the graph in runtime, rather than relying on `tsc` Follow-up PRs: - https://github.com/langchain-ai/langgraphjs/pull/1024 - https://github.com/langchain-ai/langgraphjs/pull/1025 - https://github.com/langchain-ai/langgraphjs/pull/1029 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 19:17:32 -05:00
yindo closed this issue 2026-02-15 19:17:32 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#1175