Skip to content

Be able to fetch attestations from the EAS graph in the backend #19

@oscarwroche

Description

@oscarwroche

Quoth ChatGPT:

Use a thin Backend-For-Frontend that calls The Graph when you need:

  • Keys/secrets (Graph Studio, private subgraphs, or provider fallbacks) you don’t want to expose in the browser,
  • Caching and stability (set Cache-Control, retries, backoff; shield the UI from Graph hiccups),
  • Normalization / versioning (subgraph schema changes → keep your API stable),
  • Joins with your DB (e.g., merge attestations with your profiles table or permissions),
  • Aggregation (leaderboards, counts, “top skills”, pagination windows),
  • Rate limiting and abuse protection,
  • GDPR/logging control (avoid leaking user traces to third parties directly),
  • Consistent formatting across clients (web, mobile).

Pattern:

  • /api/attestations?address=…&skill=… → your backend:

    1. Queries The Graph,
    2. Merges/filters with Postgres (optional),
    3. Responds with a stable DTO,
    4. Sends cache headers (s-maxage, stale-while-revalidate) for CDNs.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions