2023-01-20backend
GraphQL + Apollo Client for land rentals
- Change: Apollo Client (
@apollo/client ^3.7.4) added alongside the existing SWR/Axios layer (d63f58f9"wip: adding graphql",f4f8f70d"Merge branch 'preview' into adding-graphql"). Points at The Graph's Decentraland rentals subgraph for land rental market data. - Why: The rentals dataset was only available as a GraphQL subgraph — no REST equivalent existed. Apollo was the path of least resistance given the existing React tree, and The Graph's hosted service made the subgraph easy to query without running your own indexer.
- Affected Modules:
src/lib/data/,pages/api/,package.json - Trade-offs:
- Pro: Clean access to rental market data with typed GraphQL queries; no need to build a custom indexer.
- Con: Two async data layers (SWR + Apollo) with completely separate caches; cache invalidation is not coordinated; ~30 KB added to the bundle.