Urgent.News

One page, thousands of outlets. See who else covered it.

Editions

Tech

Count the Resolver, Not the Query, to Catch a GraphQL N+1

You will catch a GraphQL N+1 much earlier by counting how many times your batch loader is called against a temporary mock server than by measuring response time, because latency tests hide the problem behind small local datasets, in-memory caches, and a developer machine that is simply too fast to notice. The classic mistake is to add a deeply nested field, run one query that returns three posts,…

Counting batch loader calls instead of measuring response time helps catch GraphQL N+1 problems early. Developers often miss the issue by seeing snappy response times with small datasets and single loads. The real problem surfaces when the same query runs in production with larger datasets and remote storage. The solution is to observe the number of times a batch loader is called, which should remain constant regardless of dataset size.

Create a mock server that records batch sizes every time the batch loader function is called. Then, add an assertion to check if the largest batch size matches the number of unique keys in the response. If a query asks for ten distinct authors, the batch size should be ten, not ten separate batches of size one. This method works as a regression gate, independent of the model, network, or intuition about performance.

Start with a resolver map treating authors as remote resources and a get_author_batch function that logs its input length. Then, execute a generated corpus of queries that traverse the nested relationship in various ways. The model can produce awkward cases to test inefficient resolvers. A simple loop over generated queries and a mock server exposing batch logs can be run in CI.

The technique is useful for finding common structural bugs in hand-written resolvers that unintentionally cause nested loops. Remember, this is not meant for tuning latency or proving endpoint speed.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

How to Handle O365 Shared Mailboxes in CI/CD Test Automation

Testing email workflows—like OTP verification, password resets, or automated notifications—is a core requirement for robust end-to-end (E2E) automation.

  • Register Azure AD app with Mail.ReadWrite and Mail.Send permissions
  • Obtain OAuth 2.0 tokens via Azure AD token endpoint
  • Send emails through shared mailbox using POST request to sendMail endpoint

How I Built a Chrome Extension to Analyze Viral Social Content (Statly)

As a developer and creator, figuring out what actually drives engagement on social platforms like Instagram, TikTok, and X usually requires hours of manual digging or expensive analytics tools.

  • Developer creates Statly to analyze social content engagement
  • Tool distinguishes detailed content performance from high-level metrics
  • Statly available at trystatly.com with feedback submission option

Your dog walker says they went. This makes the walk say so too.

This is a submission for Weekend Challenge: Dog Days Edition TL;DR — A walker records the walk on their phone, the route is hashed in the browser, and a 147-byte attestation signed by the walker's own…

  • Dog walker records and hashes walk route on Solana devnet
  • Owner verifies walk trace by comparing computed hash with attestation
  • Verification process requires only two clicks without wallets or SOL

Raku: a language that counts to infinity (Part 1)

We've already seen that Raku understands characters like ∞ , and it would be logically that you can use them with ease, similar to any other constructs of the language.

  • Raku language handles infinite sequences using symbols like infinity (∞)
  • Infinite sequences can be defined with patterns and filtered by conditions
  • Lazy computations in Raku only calculate values as needed

Week 9 of #100DaysOfCode: A Week of Deep Spring Learning

Introduction This week, I decided to slow down and go deeper into the Spring Framework . Instead of focusing heavily on building new features, I spent most of my time understanding what happens behind…

  • Day 52: Learned Spring Caching fundamentals and its role in improving application performance
  • Day 53: Completed reading Spring Caching, understanding AOP and Around Advice for caching behavior

More from Sunday 16 August →