<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/langgraph-with-typescript-1-nodes-state-and-edges-7d3kjyoky" -->

---
title: LangGraph with TypeScript—1: Nodes, State and Edges
description: A hands-on introduction to LangGraph in TypeScript covering its three core building blocks: state, nodes and edges. Walks through creating a StateSchema,...
canonical: https://daily.dev/posts/langgraph-with-typescript-1-nodes-state-and-edges-7d3kjyoky
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: LangGraph with TypeScript—1: Nodes, State and Edges | daily.dev
og:description: A hands-on introduction to LangGraph in TypeScript covering its three core building blocks: state, nodes and edges. Walks through creating a StateSchema,...
og:url: https://daily.dev/posts/langgraph-with-typescript-1-nodes-state-and-edges-7d3kjyoky
og:image: https://api.daily.dev/og/posts/7d3kjyOKy.png
og:image:alt: LangGraph with TypeScript—1: Nodes, State and Edges
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# LangGraph with TypeScript—1: Nodes, State and Edges

**[Telerik](https://daily.dev/sources/telerik)** · 8 min read · 2 upvotes · 0 comments

## Summary

A hands-on introduction to LangGraph in TypeScript covering its three core building blocks: state, nodes and edges. Walks through creating a StateSchema, reducer functions for merging partial updates, synchronous and stateful nodes, and linear edges connecting them with addNode(), addEdge() and .compile(). Concludes by assembling a simple FIFA World Cup chatbot using OpenAI's GPT model wired together with these concepts, with conditional routing and streaming promised for a follow-up article.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.telerik.com/blogs/learning-langgraph-typescript-1-understanding-nodes-state-edges>

## Questions this post answers

### How does LangGraph decide whether to merge or overwrite a state update from a node?

It depends on the state schema's merge strategy, not the node itself. If a field is defined as a ReducedValue, LangGraph merges each partial update into the current value using a reducer function that takes the current value and the next value and returns the new stored value. If a field is a standard field, each update simply replaces the previous value in a last-write-wins fashion.

_daily.dev surfaces practical breakdowns like this for developers designing state flow in LangGraph agents._

### What is the difference between addEdge and addConditionalEdges in LangGraph?

addEdge(startKey, endKey) creates an unconditional edge: once the startKey node completes, execution always proceeds to endKey regardless of state. It does not evaluate any conditions. For conditional routing, such as branching based on a value in state (for example routing differently if a count exceeds 5), addConditionalEdges() is required instead.

_Developers wiring up LangGraph control flow can track deeper edge-routing guides on daily.dev._

## Similar posts on daily.dev

- [Building a LangGraph Agent from Scratch](https://daily.dev/posts/building-a-langgraph-agent-from-scratch-iwouhkssg) · Towards Data Science · 1 upvotes · 0 comments
- [How to Develop AI Agents Using LangGraph: A Practical Guide](https://daily.dev/posts/how-to-develop-ai-agents-using-langgraph-a-practical-guide-gbublyg7z) · freeCodeCamp · 3 upvotes · 0 comments
- [Building Agentic Workflows in Python with LangGraph](https://daily.dev/posts/building-agentic-workflows-in-python-with-langgraph-k9bojzede) · Machine Learning Mastery · 1 upvotes · 0 comments
- [LangGraph’s Execution Model is Trickier Than You Might Think](https://daily.dev/posts/langgraph-s-execution-model-is-trickier-than-you-might-think-3lyi5zsqk) · Atomic Spin · 3 upvotes · 0 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#typescript](https://daily.dev/tags/typescript), [#openai](https://daily.dev/tags/openai), [#langchain](https://daily.dev/tags/langchain), [#langgraph](https://daily.dev/tags/langgraph)

[View this post on daily.dev](https://daily.dev/posts/langgraph-with-typescript-1-nodes-state-and-edges-7d3kjyoky)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"LangGraph with TypeScript—1: Nodes, State and Edges","url":"https://daily.dev/posts/langgraph-with-typescript-1-nodes-state-and-edges-7d3kjyoky","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/langgraph-with-typescript-1-nodes-state-and-edges-7d3kjyoky"},"datePublished":"2026-08-26T19:17:41.812Z","dateModified":"2026-09-13T18:57:29.873Z","description":"A hands-on introduction to LangGraph in TypeScript covering its three core building blocks: state, nodes and edges. Walks through creating a StateSchema,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1c3d7ff2bcf85a33e5bb2cf5d889558c?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1c3d7ff2bcf85a33e5bb2cf5d889558c?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Telerik","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Telerik","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/5ee6d4bef8ac4f84886d06f5881963e7","url":"https://daily.dev/sources/telerik"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/langgraph-with-typescript-1-nodes-state-and-edges-7d3kjyoky","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,typescript,openai,langchain,langgraph","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Telerik","item":"https://daily.dev/sources/telerik"},{"@type":"ListItem","position":3,"name":"LangGraph with TypeScript—1: Nodes, State and Edges"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/langgraph-with-typescript-1-nodes-state-and-edges-7d3kjyoky#faq","mainEntity":[{"@type":"Question","name":"How does LangGraph decide whether to merge or overwrite a state update from a node?","acceptedAnswer":{"@type":"Answer","text":"It depends on the state schema's merge strategy, not the node itself. If a field is defined as a ReducedValue, LangGraph merges each partial update into the current value using a reducer function that takes the current value and the next value and returns the new stored value. If a field is a standard field, each update simply replaces the previous value in a last-write-wins fashion. daily.dev surfaces practical breakdowns like this for developers designing state flow in LangGraph agents."}},{"@type":"Question","name":"What is the difference between addEdge and addConditionalEdges in LangGraph?","acceptedAnswer":{"@type":"Answer","text":"addEdge(startKey, endKey) creates an unconditional edge: once the startKey node completes, execution always proceeds to endKey regardless of state. It does not evaluate any conditions. For conditional routing, such as branching based on a value in state (for example routing differently if a count exceeds 5), addConditionalEdges() is required instead. Developers wiring up LangGraph control flow can track deeper edge-routing guides on daily.dev."}}]}
```

