---
title: "pg_graphql 1.5.7: pagination and multi-tenancy support"
description: "pg_graphql 1.5.7 adds offset-based pagination alongside existing keyset pagination, per-role schema caching for schema-per-tenant multi-tenancy, and array filter operators."
url: "https://swe.quest/articles/pg-graphql-1-5-7-pagination-and-multi-tenancy-support-559a18cac63b25ac"
canonical: "https://supabase.com/blog/pg-graphql-1-5-7"
source: "Supabase"
published: "2024-08-15"
difficulty: "medium"
kind: "Release"
reading_minutes: 2
tags: ["graphql","postgres","multi-tenancy","caching"]
---

# pg\_graphql 1.5.7: pagination and multi-tenancy support

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2024-08-15, 2 min read, Release. Original: [https://supabase.com/blog/pg-graphql-1-5-7](https://supabase.com/blog/pg-graphql-1-5-7)

## Summary

pg\_graphql 1.5.7 adds offset-based pagination alongside existing keyset pagination, per-role schema caching for schema-per-tenant multi-tenancy, and array filter operators. Offset pagination maps to SQL LIMIT/OFFSET and gets slower as offsets grow, so keyset pagination remains the recommended approach. Since 1.5.2 the schema cache, keyed by Postgres role and schema version, loads only schemas the role has USAGE on. Tenants no longer all rebuild their caches when one tenant changes its schema, and this setup now serves a project with over 2,200 tenants. Since 1.5.6, contains, containedBy and overlaps filters work on scalar array columns such as text\[\].

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [GraphQL](https://swe.quest/tags/graphql.md) (Backend & APIs)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Multi-tenancy](https://swe.quest/tags/multi-tenancy.md) (Architecture & design)
- [Caching](https://swe.quest/tags/caching.md) (Backend & APIs)

## Prerequisites

- GraphQL queries ([easy posts on GraphQL](https://swe.quest/tags/graphql.md?difficulty=easy))
- PostgreSQL roles and schemas ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))

## Keywords

pg\_graphql, Supabase, PostgreSQL, keyset pagination

## Related posts

- [pg\_graphql: A GraphQL extension for PostgreSQL](https://swe.quest/articles/pg-graphql-a-graphql-extension-for-postgresql-3a34efbe6d730fc2.md): Supabase · 2021-12-03 · Medium · 4 min read · GraphQL, PostgreSQL, API design
  pg\_graphql is an open-source PostgreSQL extension, written in C and SQL, that reflects a GraphQL schema from existing tables and resolves queries entirely inside the database.
- [pg\_graphql v1.0](https://swe.quest/articles/pg-graphql-v1-0-5a4770d60b17d945.md): Supabase · 2022-12-16 · Medium · 5 min read · GraphQL, PostgreSQL, Rust, Performance engineering
  pg\_graphql, a PostgreSQL extension that compiles GraphQL requests into a single SQL query, reaches 1.0 with a SemVer backwards-compatibility guarantee.
- [pg\_graphql: Postgres functions now supported](https://swe.quest/articles/pg-graphql-postgres-functions-now-supported-279553dc083ab4d8.md): Supabase · 2023-12-12 · Medium · 4 min read · GraphQL, PostgreSQL, API design
  pg\_graphql 1.4+ reflects Postgres user-defined functions into the GraphQL schema, giving custom SQL logic a GraphQL entry point.
- [What's New in pg\_graphql v1.2](https://swe.quest/articles/what-s-new-in-pg-graphql-v1-2-8e0869fac360da26.md): Supabase · 2023-04-21 · Medium · 4 min read · GraphQL, PostgreSQL, API design
  pg\_graphql v1.1–1.2 now reflects views, materialized views and foreign tables into the GraphQL schema, with primary keys declared via a comment directive.
- [GraphQL is now available in Supabase](https://swe.quest/articles/graphql-is-now-available-in-supabase-1d65691e837f8256.md): Supabase · 2022-03-29 · Medium · 6 min read · GraphQL, PostgreSQL, API design, Performance engineering
  Supabase has made GraphQL generally available through pg\_graphql, an open source PostgreSQL extension that reflects tables, columns and foreign keys into GraphQL types, fields and relations, queryable from SQL or over HTTP.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
