Skip to content

Instantly share code, notes, and snippets.

View rodrigo-arias's full-sized avatar

Rodrigo Arias rodrigo-arias

View GitHub Profile
@rodrigo-arias
rodrigo-arias / wpgraphql-non-public-post-tracker.md
Last active September 14, 2026 18:27
Tag WPGraphQL Smart Cache responses with non-public post IDs so draft→publish purges cached nulls — workaround for wp-graphql#4298

WPGraphQL Smart Cache: purge cached nulls when a draft is published

Workaround for wp-graphql#4298: a public query for a non-public post's URI caches a null response with no post:<id> tag in X-GraphQL-Keys, so publishing the post can never invalidate it — the query stays a HIT on stale null until TTL.

What it does

Tracks nodes that are resolved but not returned, without touching the security model (responses stay null; only the cache tag is added):

  1. graphql_resolve_uri — when NodeResolver found nothing, re-query with non-public statuses and feed the match through the post loader (its visibility gate still nulls it out).
  2. graphql_dataloader_pre_get_model — capture the IDs the loader filters out.
@rodrigo-arias
rodrigo-arias / pnpm-audit.md
Last active July 15, 2026 19:25
Run pnpm audit despite pnpm 10 pins and npm's retired audit endpoints — with a --summary view by severity and root dependency

pnpm-audit

pnpm audit on pnpm ≤ 10 started failing on 2026-07-15 when npm retired the legacy audit endpoints (pnpm#11265):

ERR_PNPM_AUDIT_BAD_RESPONSE ... responded with 410: This endpoint is being retired.

pnpm 11 uses the new bulk advisory endpoint — but if your repo pins pnpm 10 via