Skip to main content

Posts

Showing posts from 2024

GraphQL Essentials: From Basics to Federation

Greetings! Over the past two years, I have been engaging with GraphQL intermittently, not always as part of day-to-day development. However, now feels like the right time to consolidate key ideas into a comprehensive article. What is GraphQL? GraphQL is a query language for APIs and a runtime for executing those queries based on your data. It provides a more flexible and efficient alternative to traditional REST APIs by allowing clients to request only the data they need, reducing over-fetching and under-fetching. Unlike REST, where endpoints are tightly coupled to specific data structures, GraphQL operates on a single endpoint and allows dynamic queries. A GraphQL server Key Features of GraphQL Single Endpoint: All requests are sent to a single endpoint. Strongly Typed: A schema defines the data structure and enforces types. Declarative Queries: Clients specify the shape of the response they need. Real-time Support: Through subscriptions, clients can receive real-time updates. Introsp...

Let's build our own online multiplayer chess game

Greetings! Chess is a hobby I enjoy, and as a chess fan, I often play online at chess.com. But you know what's even more thrilling? Creating our very own online chess game! I'm excited to share my experience with anyone interested! Source Code: GitHub (slmanju) Final result (using two browser windows) Chess game Chess is a complex board game played by two players. When a player makes a valid move we need to make it appear on other players board. What else, pieces, rules, communication, and lots of complex things are happening. I don't want to reinvent such complex things when things are free. Aha... the free stuff It's challenging to create all the necessary elements from scratch. Why go through the trouble when there are plenty of excellent free resources readily available? Let's make use of what's already out there. Chess pieces - wikimedia Chess rule - chess.js Chess board - chessboard....