Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1622 commits
Select commit Hold shift + click to select a range
d2ccbd1
Created a new blog post about the data API (#35762)
CoolAssPuppy May 20, 2025
cb79c2a
fix logs datepickers state not refreshing on page load (#35755)
jordienr May 20, 2025
63139b9
Pass params to signup page (#35764)
saltcod May 20, 2025
25903cb
fix: edge function auto refetching (#35769)
alaister May 20, 2025
ac04e0d
test(content api): add prod smoke tests for searchDocs (#35528)
charislam May 20, 2025
109ad11
docs(auth): mention that leaked password protection only on paid plan…
charislam May 20, 2025
419ae47
chore(docs): bump linter version (#35724)
charislam May 20, 2025
60d9202
Docs: Improve chip text in Dart and Kotlin examples (#35740)
hieuwu May 20, 2025
4d0a2b6
fix(db): remove failing statement in migration (#35780)
charislam May 20, 2025
fdd81f1
Added two new case studies and fixed a thumb on a blog post (#35781)
CoolAssPuppy May 20, 2025
959f5a4
fix(content api): bug with returning edges (#35783)
charislam May 20, 2025
7f635fe
blog: update authors in Simplifying back-end (#35784)
steve-chavez May 20, 2025
ffceb79
chore(docs): add sentry monitoring (#35529)
charislam May 20, 2025
b5921d1
chore(content api): reduce max depth (#35530)
charislam May 20, 2025
3bcc37e
Customer provided better quotes. (#35795)
CoolAssPuppy May 21, 2025
23ead00
fix(studio): fallback to count estimate if exact count query timeout …
avallete May 21, 2025
5219797
fix(studio): use null last order by default (#35794)
avallete May 21, 2025
c9ee6bc
fix(studio): self-hosted assistant authorization header (#35804)
alaister May 21, 2025
08bde13
add portal true to database selector (#35807)
jordienr May 21, 2025
963eabc
chore(docs): log caught page errors in sentry (#35810)
charislam May 21, 2025
863de8a
update documentation on self-hosted psql timezone management (#35801)
h0lm1 May 21, 2025
3bfc748
fix(troubleshooting sync): use proper graphql variables (#35813)
charislam May 21, 2025
d8fe840
feat(db): error table (#35817)
charislam May 21, 2025
9fde328
docs(realtime): include DatabaseLackOfConnections error code (#35824)
edgurgel May 22, 2025
c68374f
Docs: add guide migrate auth users between projects (#35797)
monicakh May 22, 2025
49c677d
feat: add sign in with solana (web3) configuration UI (#34909)
hf May 22, 2025
6ee89f7
update org invite error (#35832)
jordienr May 22, 2025
4fcc6f3
Update user impersonation search (#35717)
saltcod May 22, 2025
4eccdc1
Fix EF editor font size (#35839)
saltcod May 22, 2025
88c9bd6
Add data-testid to log selection id (#35834)
jordienr May 22, 2025
8d339f7
examples: Add OpenAI image gen API example (#35840)
dshukertjr May 22, 2025
3b771c5
fix: hide credit balance section if billed via partner (#35841)
kevcodez May 22, 2025
3370ecc
fix(docs): graphql page links (#35846)
charislam May 22, 2025
6fcb98d
docs(pg17): add docs on pg17 upgrades (#35431)
charislam May 22, 2025
b7c83df
chore(docs): turn off sentry sends for local dev (#35852)
charislam May 22, 2025
bcc3922
fix: update pgmq official docs link (#35855)
w3b6x9 May 22, 2025
9fa1b66
Fix: slack integration and sample code (#35862)
doublethink May 23, 2025
6544844
docs: add web3 docs (#35650)
hf May 23, 2025
159455c
SEO changes requested by the agency (#35867)
CoolAssPuppy May 23, 2025
fda426b
Improvements to Reports > Database (#35477)
fsansalvadore May 23, 2025
76b123c
chore: Add a badge on extension card to deprecated extensions (#35868)
ivasilov May 23, 2025
49774ac
default to last 24h in free, 7 days in paid (#35799)
jordienr May 23, 2025
01503ea
Chore/db report legend (#35871)
fsansalvadore May 23, 2025
b106075
Add rel=edit attribute to GitHub docs edit link (#35678)
capjamesg May 23, 2025
16785bb
feat: add api key, role details to api gateway logs (#35800)
hf May 23, 2025
b4fb59b
chore(docs): drop sentry errors from extensions and user apps (#35854)
charislam May 23, 2025
9ff0a63
Adding note to broadcast_changes that is uses a private channel. (#35…
GaryAustin1 May 23, 2025
d23e6b7
fix: non-hipaa projects can disable PITR (#35880)
staaldraad May 23, 2025
e71fa28
docs(api): Remove beta from build-a-supabase-integration.mdx (#35878)
kamilogorek May 23, 2025
806e6e9
docs: update cli installation step for pnpm (#35877)
sweatybridge May 23, 2025
17efbe1
chore(docs): loosen overly strict sentry filter (#35882)
charislam May 23, 2025
d218d91
fix(privacy settings): toReversed use (#35885)
charislam May 23, 2025
bd7334d
add clearer doc links to disabled projects (#35587)
PLyn May 24, 2025
4c91016
docs: default cli installation guide to npm (#35833)
sweatybridge May 26, 2025
5abafd7
feat: improve org vs project scopes roles definition (#35920)
phamhieu May 26, 2025
50518c8
[FE-1648] fix: privacy settings failed to load state (#35869)
alaister May 26, 2025
854f6d9
fix: broken link for HubSpot API key helper (#35791)
burmecia May 26, 2025
fa2c766
fix(consent-state): add IS_PLATFORM check in initUserCentrics() (#35805)
nicetomytyuk May 26, 2025
b492341
chore: make MildTomato codeowner of packages (#35558)
staaldraad May 26, 2025
4add928
chore: Update API types (#35879)
ivasilov May 26, 2025
318280f
add copy table schema option to table dropdown (#35909)
jordienr May 26, 2025
2fa17af
Project Usage: fix types and component (#35934)
jordienr May 26, 2025
fc09d11
blog: open data standard (#35930)
kiwicopple May 26, 2025
b411ed3
chore: rename sink to destination for the etl api (#35931)
imor May 26, 2025
f67d327
bugfix: slack integration (#35916)
doublethink May 26, 2025
e8f4273
fix default enable state for auth hooks to be true (#35942)
PLyn May 26, 2025
4230c5a
Added some missing features from LW14 to the feature catalog (#35937)
CoolAssPuppy May 26, 2025
adb8512
docs(troubleshooting): make docs on server-side admin clearer (#35815)
charislam May 27, 2025
d61d32f
fix new replica click (#35808)
jordienr May 27, 2025
7eaaaae
Add query ids to reports (#35836)
jordienr May 27, 2025
88066ce
Add error boundary to AI Assistant (#35850)
jordienr May 27, 2025
f8b3bfc
Feat/privacy policy update (#35923)
pamelachia May 27, 2025
4ea088d
chore: respect retry-after header for rate-limiting (#35957)
alaister May 27, 2025
4f2b09b
neon page (#35759)
fsansalvadore May 27, 2025
9318404
Feat/api keys rollout prep (#35559)
MildTomato May 27, 2025
bf3bada
test: run supabase locally during test (#35947)
charislam May 27, 2025
22ae9a2
feat(db): error table updating function (#35819)
charislam May 27, 2025
5dc929a
chore(docs linter): fix external prs workflow (#35785)
charislam May 27, 2025
37d92e8
refactor(docs): turn auth error codes table into data file (#35857)
charislam May 27, 2025
cade7f1
chore: add "Felipe Stival" on humans.txt (#35962)
v0idpwn May 27, 2025
de30066
[bot] sync troubleshooting guides to db (#35954)
github-actions[bot] May 27, 2025
c498a20
fixed error #35952 (#35956)
Apocalypse3007 May 27, 2025
75567e4
chore(docs): remove unnecessary toml package (#35970)
charislam May 27, 2025
075bc01
Fix jwt infinitely loading (#35848)
saltcod May 27, 2025
34022bd
Docs: Add section on logical replication for setting up CDC from Supa…
encima May 28, 2025
367ffdd
fix: get table schema on click (#35989)
alaister May 28, 2025
1862fe4
feat: add last used timestamp in the last 24h to legacy api keys (#35…
hf May 28, 2025
8aea2cd
seo(docs): canonical links for reference pages (#35977)
charislam May 28, 2025
f908da2
Fix sorting in storage explorer (#35975)
saltcod May 28, 2025
0e2183f
feat(docs): add github link to troubleshooting articles (#36000)
charislam May 28, 2025
bf45616
chore(docs): refine sentry filter (#36002)
charislam May 28, 2025
e394f0c
fix: select newer postgres version as default (#35961)
delgado3d May 29, 2025
9ee5779
chore: Update images for the trigger without superuser blogpost (#36004)
ivasilov May 29, 2025
9b1f64f
fix: don't refetch settings on inactive projects (#36017)
alaister May 29, 2025
c0c3710
fix(studio): bypass pg meta route on self-hosted for ai endpoints (#3…
alaister May 29, 2025
f6b316e
chore(docs): update required claims for access token (#36021)
cemalkilic May 29, 2025
25cea56
docs: shared pooler egress (#36009)
kevcodez May 29, 2025
62bc992
Fix storage mime type not getting set on create (#36023)
saltcod May 29, 2025
fb03d04
chore: remove lw14 tickets (#36030)
kevcodez May 29, 2025
943cf70
fix: connect remix env name (#36020)
Hallidayo May 29, 2025
f0ff6ce
fix(common): prevent errors when accessing local storage in certain b…
charislam May 29, 2025
a2342c4
docs(python): update realtime docs with async methods and notes (#36015)
silentworks May 29, 2025
ba29cf1
Add copy schema to schema vizz (#34806)
jordienr May 29, 2025
bb8c3e5
Docs: fix broken link in security performance advisor features (#36031)
monicakh May 29, 2025
21412b2
Add option to force sign out (#35991)
jordienr May 29, 2025
70bdeec
add coverage option to ui-patterns (#35669)
jordienr May 29, 2025
a61a39f
docs: compliance (#36016)
kiwicopple May 29, 2025
a0a31f0
ci(docs lint): fix workflow for external lints (#35968)
charislam May 29, 2025
4e547b3
ci(docs lint): fix workflow_run condition (#36038)
charislam May 29, 2025
aba0095
feat(content api): add error endpoint (#35941)
charislam May 29, 2025
33b9e1e
chore(docs): convert all scripts to esm (#35996)
charislam May 29, 2025
f58eead
chore(docs): clean up environment variables (#36036)
charislam May 29, 2025
f202666
fix: Sandbox email preview frame (#36010)
doublethink May 30, 2025
181f157
chore: Move the files in `ui-patterns` under `src` folder (#36032)
ivasilov May 30, 2025
0ffe63f
add replication area to dashboard (#35946)
saltcod May 30, 2025
8f2993d
docs: Add JSON type support for generated typescript types (#36013)
dshukertjr Jun 1, 2025
363b976
Fix service checks coming up state (#35705)
joshenlim Jun 2, 2025
2909965
fix: delete row loading spinner (#36104)
alaister Jun 2, 2025
c31ac25
Update auth-send-email-hook-react-email-resend.mdx - typo (#36103)
maxwellmandela Jun 2, 2025
2f4faec
fixed breaking of replication link in doc (#36093)
ItsRoy69 Jun 2, 2025
df9c1bc
ci(docs): scheduled linter (#36116)
charislam Jun 2, 2025
069c899
Improve `supabase link` documentation (#36083)
levity Jun 2, 2025
14fd307
fix: auth docs - removed example line (#36078)
Hallidayo Jun 2, 2025
3c06705
style: add comma to the Applied to target roles (#36067)
Mohammed-Yasin-Mulla Jun 2, 2025
f841062
fix: doc link spacing on disabled projects (#35899)
PLyn Jun 2, 2025
8394749
Add user token initialization in auth.mdx (#32997)
filippobrigati Jun 2, 2025
0e28054
docs(self-hosted env): fix odd format for example .env file (#36120)
charislam Jun 2, 2025
e3904ef
chore: update self-hosted image versions (#36125)
kiwicopple Jun 3, 2025
ade0e40
chore: update cli reference doc (#36126)
kiwicopple Jun 3, 2025
eb7f5bc
Use email instead of username in org member list (#36122)
saltcod Jun 3, 2025
ba00185
Add ef loading state (#36124)
saltcod Jun 3, 2025
0254adf
Re add 7 day option (#35958)
jordienr Jun 3, 2025
b58eaec
Update global error boundary component FE-1662 (#36113)
jordienr Jun 3, 2025
03dcbef
Tiny patch table editor (#36131)
joshenlim Jun 3, 2025
526fbee
Patch (#36133)
joshenlim Jun 3, 2025
ac670e2
Configure restricted region pool from configcat (#36105)
joshenlim Jun 3, 2025
e656559
chore: handle fair use alerts when pro plan (#36123)
pamelachia Jun 3, 2025
f7d90bb
feat: new cms app (#35999)
fsansalvadore Jun 3, 2025
792e231
fix schema selector in create fn sheet (#36141)
jordienr Jun 3, 2025
6ac5368
revalidate careers page w/ISR (#36143)
fsansalvadore Jun 3, 2025
4f6e65a
state of startups 2025 (#36047)
fsansalvadore Jun 3, 2025
6e444c5
docs: fixed typo in color usage (#36137)
clarencepenz Jun 3, 2025
55c3fdb
E2E Testing Setup Consolidation (#35080)
jordienr Jun 3, 2025
b2e368b
Chore/api keys cleanup (#36097)
joshenlim Jun 4, 2025
80e8c14
fix home counts (#36157)
SaxonF Jun 4, 2025
a8336ef
Fix broken link to replication guide (#36069)
encima Jun 4, 2025
80b4d9d
Adjust open new tab SQL Editor CTA (#36163)
joshenlim Jun 4, 2025
2df44bc
Fix cmd i not closing AI assistant (#36164)
joshenlim Jun 4, 2025
450803a
feat: bump auth-js to `2.71.0-rc.2` (#36170)
cemalkilic Jun 4, 2025
10b5402
Added new blog post and modified some docs for SEO (#36171)
CoolAssPuppy Jun 4, 2025
8091ef1
careers page ssr (#36166)
fsansalvadore Jun 4, 2025
2cd0f3c
fix: possibly undefined breakdown in plan update modal (#36155)
kevcodez Jun 4, 2025
2181fed
Docs: clarify how to enable column level privileges (#36161)
monicakh Jun 4, 2025
cd57308
Log Explorer improvements (#36140)
jordienr Jun 4, 2025
62fbe17
fix(ui library): fix redirects (#36118)
charislam Jun 4, 2025
a137694
docs(troubleshooting): add soft delete article (#36121)
charislam Jun 4, 2025
0e7422c
Fix pointer events none preventing contact support click (#36173)
jordienr Jun 4, 2025
49b9fe4
dev(docs,cursor): add rule for running docs tests (#36150)
charislam Jun 4, 2025
5862505
fix infinite loop in api keys (#36175)
jordienr Jun 4, 2025
cf3ecc9
chore(docs): turn on strictNullChecks (#36180)
charislam Jun 4, 2025
07ec770
chore: remove unnecessary $ in usage page (#36176)
bodinsamuel Jun 4, 2025
cc65075
docs: fixed typo in color usage (#36167)
clarencepenz Jun 4, 2025
2d0b321
fix(table-editor): handle multi-dimentional array truncation and prev…
avallete Jun 5, 2025
671aea0
fix: use LOGFLARE_PRIVATE_ACCESS_TOKEN for querying, LOGFLARE_PUBLIC_…
Ziinc Jun 5, 2025
73e6f97
docs: add web3 cli instructions (#36188)
hf Jun 5, 2025
7e9076e
chore: Bump the rest of the apps to Nextjs 15 (#35475)
ivasilov Jun 5, 2025
ae4f2b3
feat(auth): add experimental userStorage support (#36195)
cemalkilic Jun 5, 2025
3158807
ci(docs): sync script (#36001)
charislam Jun 5, 2025
4b9662b
ci(docs lint): fix commenting workflow (#36062)
charislam Jun 5, 2025
388de33
[bot] sync troubleshooting guides to db (#36202)
github-actions[bot] Jun 5, 2025
32d7fb9
fix: corrected 'सुपबेस' to 'सुपाबेस' for consistent spelling in READM…
btwitskaif69 Jun 5, 2025
31f1d08
fix: Update Sentry filters (#36207)
ivasilov Jun 5, 2025
3a22696
feat: add installation buttons for VS Code MCP server (#36146)
burkeholland Jun 5, 2025
c665e0b
Add context menu to Tabs Interface for closing tabs (#36192)
joshenlim Jun 6, 2025
db44d6e
chore: add "Taryn King" to humans.txt (#36179)
tk1ng Jun 6, 2025
908444c
assistant button in help popover (#36184)
SaxonF Jun 6, 2025
d75cb8b
fix: studio circular imports (#36026)
alaister Jun 6, 2025
b7234ea
chore: use larger runner group rather than a single larger runner (#3…
pcnc Jun 6, 2025
7fe2c11
fix: Add admonition about pitr to new project for vercel marketplace …
kamilogorek Jun 6, 2025
c0b6ebd
db: add id to error table (#36208)
charislam Jun 6, 2025
0f4db5e
improve image search README with setup and usage examples (#36228)
shivas1432 Jun 6, 2025
fdcf54b
Update humans.txt - Aaron Byrne (#36217)
aaronByrne1 Jun 6, 2025
36f75c5
docs(api keys): remove outdated location and video (#36226)
charislam Jun 6, 2025
8fe31d9
Chore/feedback classifier (#36147)
saltcod Jun 6, 2025
8b8bddd
docs(extensions): mark extensions deprecated in pg17 (#36232)
charislam Jun 6, 2025
6d5f7f2
chore: Add flag to deprecate pgjwt in `shared-data` (#36233)
ivasilov Jun 6, 2025
daf8b3c
Create branch without GitHub connection (#35983)
SaxonF Jun 9, 2025
4c1349f
remove optional label if gitless branching feature flag disabled (#36…
SaxonF Jun 9, 2025
7105df3
Layout Editor + Keyboard Shortcuts improvements (#36165)
jordienr Jun 9, 2025
354c9b6
feat: add additional connection metrics to report (#36225)
JGjorgji Jun 9, 2025
b65b6c6
fix: bump auth-js to 2.71.0-rc.4 (#36229)
hf Jun 9, 2025
95d15b8
fix: link to larger compute sizes (#36268)
kevcodez Jun 9, 2025
c4cb660
Slight tweaks to toolbar icons (#36269)
SaxonF Jun 9, 2025
4791e3c
inbox icon size (#36273)
SaxonF Jun 9, 2025
2a26c3b
fix: remove trailing comma in SQL example in queues blog post (#36257)
saltcod Jun 9, 2025
d06c712
docs: fixed typo in color usage (#36275)
clarencepenz Jun 9, 2025
c8dbd58
Add missing word in secrets.mdx (#36261)
Zander-Davidson Jun 9, 2025
4e916fc
feat(graphql): add paginated errors collection query (#36149)
charislam Jun 9, 2025
74a3be9
feat: add workos tpa ui behind feature flag (#36254)
hf Jun 9, 2025
3c390c7
chore: Use npm specifier instead of jsr for supabase-js imports (#36291)
laktek Jun 10, 2025
cacfe7f
fix: use configcat proxy (#36130)
kangmingtay Jun 10, 2025
b2b915d
sos25 og (#36294)
fsansalvadore Jun 10, 2025
586a829
feat: Project claim (#35992)
ivasilov Jun 10, 2025
8709747
chore: move HIPAA checks from org to project level (#35925)
staaldraad Jun 10, 2025
69ce2d8
update www content (#36191)
fsansalvadore Jun 10, 2025
257e04d
Manually updated org query data after creating a new org (#36301)
joshenlim Jun 10, 2025
515359c
fix: more api key ui fixes (#36300)
hf Jun 10, 2025
ec475cc
multi (#36305)
kiwicopple Jun 10, 2025
fba3f7b
feat(docs): add error code filtering to GraphQL errors endpoint (#36284)
charislam Jun 10, 2025
66ad615
Reinstate pnpm command for running studio in non hosted mode (#36309)
joshenlim Jun 10, 2025
54f8091
monitoring(docs,content api): send resolver errors to sentry (#36308)
charislam Jun 10, 2025
5de791a
chore(docs): add branching secrets managements docs (#36306)
avallete Jun 10, 2025
889d5a5
docs: update the message for users with deprecated extensions (#36307)
samrose Jun 10, 2025
7269f87
chore: change copy (#36314)
fsansalvadore Jun 10, 2025
ee30877
docs: fixed typo in tailwind classes (#36299)
clarencepenz Jun 10, 2025
29f62ea
chore: remove privacy banner (#36312)
pamelachia Jun 11, 2025
64d3d1f
chore: Bump vulnerable dependencies (#36272)
ivasilov Jun 11, 2025
8519cb1
fix: managed by header (#36325)
kevcodez Jun 11, 2025
885df2f
fix: When claiming a project, first authorize the oAuth app (#36329)
ivasilov Jun 11, 2025
0695e4e
fix: include primary database identifier in API report filtering (#36…
jose-ledesma Jun 11, 2025
95e45d2
Restore spaces (#36338)
saltcod Jun 11, 2025
eec376d
Reinstate inline editor and assistant for local CLI and self host (#3…
joshenlim Jun 11, 2025
aed02e5
www: blog typo (#35494)
Hallidayo Jun 11, 2025
64fc448
docs: warning for overloaded functions rpc (#35234)
Hallidayo Jun 11, 2025
b27a7da
Set `security definer` in `queue_embeddings` function (#35600)
cmglezpdev Jun 11, 2025
e6c5d3c
fix: trim confirmation input and comparison (#36337)
kevcodez Jun 12, 2025
28ebb85
fix: redirect to Vercel marketplace for plan change (#36351)
kevcodez Jun 12, 2025
4633768
Add is nullable column to ColumnList (#36352)
joshenlim Jun 12, 2025
aa75fef
Add org_not_found param to detect if landing on a proper org (#36341)
saltcod Jun 12, 2025
f13dc34
Add Ignacio Dobronich to humans.txt (#36358)
ignaciodob Jun 12, 2025
274bd2f
feat(docs): add database lint warnings to search index (#36368)
charislam Jun 12, 2025
3cc06f9
chore(functions): remove unused functions (#36336)
charislam Jun 12, 2025
87b04cc
fix: typo in `egress.mdx` (#36356)
arnottferels Jun 12, 2025
82715ef
Correct auth.mdx examples (#34746)
alph486 Jun 12, 2025
de3afc5
Update mcp docs local scope (#36345)
laktek Jun 13, 2025
ff318d0
feat: support pending changes (#36333)
kevcodez Jun 13, 2025
4e1a039
fix(SQLEditor): disable transactional mode for manual queries (#36367)
avallete Jun 13, 2025
27d9b44
Consolidate copy to clipboard (#36353)
joshenlim Jun 13, 2025
c4316c3
Update setup-replication-external.mdx (#36382)
Alexkane Jun 13, 2025
ddc2250
Shift positioning of "Leave team" button in Org Team Settings (#36386)
joshenlim Jun 16, 2025
c1f964b
Add edge functions empty state for local/self-host (#36322)
joshenlim Jun 16, 2025
cb29180
chore: update definition of isPaidAndNotAwsNew (#36057)
dragarcia Jun 16, 2025
06ce78a
allow select and copy text, fix context menu (#36162)
jordienr Jun 16, 2025
ee5279e
Project Homepage Charts: fix range and add product type (#36132)
jordienr Jun 16, 2025
1153a21
Fix delete button in users management (#36435)
joshenlim Jun 16, 2025
b95c759
fix(content api): restrict vercel edge function regions (#36405)
charislam Jun 16, 2025
d6aa546
Fix incorrect logic for isHipaaProjectDisallowed (#36436)
joshenlim Jun 16, 2025
7c3f795
feat: allow disabling and re-enabling of `anon` and `service_role` (#…
hf Jun 16, 2025
f96922b
docs: fix wrappers assets (images) (#36365)
tomaspozo Jun 16, 2025
985733f
Update auth-apple.mdx (#36389)
cjmling Jun 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
267 changes: 267 additions & 0 deletions .cursor/rules/docs-graphql.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
---
description: Docs GraphQL Architecture
globs: apps/docs/resources/**/*.ts
alwaysApply: false
---

# Docs GraphQL Architecture

## Overview

The `/apps/docs/resources` folder contains the GraphQL endpoint architecture for the docs GraphQL endpoint at `/api/graphql`. It follows a modular pattern where each top-level query is organized into its own folder with consistent file structure.

## Architecture Pattern

Each GraphQL query follows this structure:

```
resources/
├── queryObject/
│ ├── queryObjectModel.ts # Data models and business logic
│ ├── queryObjectSchema.ts # GraphQL type definitions
│ ├── queryObjectResolver.ts # Query resolver and arguments
│ ├── queryObjectTypes.ts # TypeScript interfaces (optional)
│ └── queryObjectSync.ts # Functions for syncing repo content to the database (optional)
├── utils/
│ ├── connections.ts # GraphQL connection/pagination utilities
│ └── fields.ts # GraphQL field selection utilities
├── rootSchema.ts # Main GraphQL schema with all queries
└── rootSync.ts # Root sync script for syncing to database
```

## Example queries

1. **searchDocs** (`globalSearch/`) - Vector-based search across all docs content
2. **error** (`error/`) - Error code lookup for Supabase services
3. **schema** - GraphQL schema introspection

## Key Files

### `rootSchema.ts`
- Main GraphQL schema definition
- Imports all resolvers and combines them into the root query
- Defines the `RootQueryType` with all top-level fields

### `utils/connections.ts`
- Provides `createCollectionType()` for paginated collections
- `GraphQLCollectionBuilder` for building collection responses
- Standard pagination arguments and edge/node patterns

### `utils/fields.ts`
- `graphQLFields()` utility to analyze requested fields in resolvers
- Used for optimizing data fetching based on what fields are actually requested

## Creating a New Top-Level Query

To add a new GraphQL query, follow these steps:

### 1. Create Query Folder Structure
```bash
mkdir resources/newQuery
touch resources/newQuery/newQueryModel.ts
touch resources/newQuery/newQuerySchema.ts
touch resources/newQuery/newQueryResolver.ts
```

### 2. Define GraphQL Schema (`newQuerySchema.ts`)
```typescript
import { GraphQLObjectType, GraphQLString } from 'graphql'

export const GRAPHQL_FIELD_NEW_QUERY = 'newQuery' as const

export const GraphQLObjectTypeNewQuery = new GraphQLObjectType({
name: 'NewQuery',
description: 'Description of what this query returns',
fields: {
id: {
type: GraphQLString,
description: 'Unique identifier',
},
// Add other fields...
},
})
```

### 3. Create Data Model (`newQueryModel.ts`)

> [!NOTE]
> The data model should be agnostic to GraphQL. It may import argument types
> from `~/__generated__/graphql`, but otherwise all functions and classes
> should be unaware of whether they are called for GraphQL resolution.

> [!TIP]
> The types in `~/__generated__/graphql` for a new endpoint will not exist
> until the code generation is run in the next step.

```typescript
import { type RootQueryTypeNewQueryArgs } from '~/__generated__/graphql'
import { convertPostgrestToApiError, type ApiErrorGeneric } from '~/app/api/utils'
import { Result } from '~/features/helpers.fn'
import { supabase } from '~/lib/supabase'

export class NewQueryModel {
constructor(public readonly data: {
id: string
// other properties...
}) {}

static async loadData(
args: RootQueryTypeNewQueryArgs,
requestedFields: Array<string>
): Promise<Result<NewQueryModel[], ApiErrorGeneric>> {
// Implement data fetching logic
const result = new Result(
await supabase()
.from('your_table')
.select('*')
// Add filters based on args
)
.map((data) => data.map((item) => new NewQueryModel(item)))
.mapError(convertPostgrestToApiError)

return result
}
}
```

### 4. Create Resolver (`newQueryResolver.ts`)
```typescript
import { GraphQLError, GraphQLNonNull, GraphQLString, type GraphQLResolveInfo } from 'graphql'
import { type RootQueryTypeNewQueryArgs } from '~/__generated__/graphql'
import { convertUnknownToApiError } from '~/app/api/utils'
import { Result } from '~/features/helpers.fn'
import { graphQLFields } from '../utils/fields'
import { NewQueryModel } from './newQueryModel'
import { GRAPHQL_FIELD_NEW_QUERY, GraphQLObjectTypeNewQuery } from './newQuerySchema'

async function resolveNewQuery(
_parent: unknown,
args: RootQueryTypeNewQueryArgs,
_context: unknown,
info: GraphQLResolveInfo
): Promise<NewQueryModel[] | GraphQLError> {
return (
await Result.tryCatchFlat(
resolveNewQueryImpl,
convertUnknownToApiError,
args,
info
)
).match(
(data) => data,
(error) => {
console.error(`Error resolving ${GRAPHQL_FIELD_NEW_QUERY}:`, error)
return new GraphQLError(error.isPrivate() ? 'Internal Server Error' : error.message)
}
)
}

async function resolveNewQueryImpl(
args: RootQueryTypeNewQueryArgs,
info: GraphQLResolveInfo
): Promise<Result<NewQueryModel[], ApiErrorGeneric>> {
const fieldsInfo = graphQLFields(info)
const requestedFields = Object.keys(fieldsInfo)
return await NewQueryModel.loadData(args, requestedFields)
}

export const newQueryRoot = {
[GRAPHQL_FIELD_NEW_QUERY]: {
description: 'Description of what this query does',
args: {
id: {
type: new GraphQLNonNull(GraphQLString),
description: 'Required argument description',
},
// Add other arguments...
},
type: GraphQLObjectTypeNewQuery, // or createCollectionType() for lists
resolve: resolveNewQuery,
},
}
```

### 5. Register in Root Schema
In `rootSchema.ts`, add your resolver:

```typescript
// Import your resolver
import { newQueryRoot } from './newQuery/newQueryResolver'

// Add to the query fields
export const rootGraphQLSchema = new GraphQLSchema({
query: new GraphQLObjectType({
name: 'RootQueryType',
fields: {
...introspectRoot,
...searchRoot,
...errorRoot,
...newQueryRoot, // Add this line
},
}),
types: [
GraphQLObjectTypeGuide,
GraphQLObjectTypeReferenceCLICommand,
GraphQLObjectTypeReferenceSDKFunction,
GraphQLObjectTypeTroubleshooting,
],
})
```

### 6. Update TypeScript Types
Run the GraphQL codegen to update TypeScript types:
```bash
pnpm run -F docs codegen:graphql
```

## Best Practices

1. **Error Handling**: Error handling always uses the Result class, defined in apps/docs/features/helpers.fn.ts
2. **Field Optimization**: Use `graphQLFields()` to only fetch requested data
3. **Collections**: Use `createCollectionType()` for paginated lists
4. **Naming**: Use `GRAPHQL_FIELD_*` constants for field names
5. **Documentation**: Add GraphQL descriptions to all fields and types
6. **Database**: Use `supabase()` client for database operations with `convertPostgrestToApiError`

## Testing

Tests are located in apps/docs/app/api/graphql/tests. Each top-level query
should have its own test file, located at <queryName>.test.ts.

### Test data

Test data uses a local database, seeded with the file at supabase/seed.sql. Add
any data required for running your new query.

### Integration tests

Integration tests import the POST function defined in
apps/docs/api/graphql/route.ts, then make a request to this function.

For example:

```ts
import { POST } from '../route'

it('test name', async () => {
const query = `
query {
...
}
`
const request = new Request('http://localhost/api/graphql', {
method: 'POST',
body: JSON.stringify({ query }),
})

const result = await POST(request)
})
```

Include at least the following tests:

1. A test that requests all fields (including nested fields) on the new query
object, and asserts that there are no errors, and the requested fields are
properly returned.
2. A test that triggers and error, and asserts that a GraphQL error is properly
returned.
71 changes: 71 additions & 0 deletions .cursor/rules/docs-test-requirements.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
description: Docs Testing Procedure
globs: apps/docs/**/*.test.ts
alwaysApply: false
---

# Docs Test Requirements

Rules for running tests in the docs application, ensuring proper Supabase setup and test execution.

<rule>
name: docs_test_requirements
description: Standards for running tests in the docs application with proper Supabase setup
filters:
# Match test files in the docs app
- type: file_extension
pattern: "\\.(test|spec)\\.(ts|tsx)$"
- type: path
pattern: "^apps/docs/.*"
# Match test execution events
- type: event
pattern: "test_execution"

actions:
- type: suggest
message: |
Before running tests in the docs app:

1. Check Supabase status:
```bash
pnpm supabase status
```

2. If Supabase is not running:
```bash
pnpm supabase start
```

3. Reset the database to ensure clean state:
```bash
pnpm supabase db reset --local
```

4. Run the tests:
```bash
pnpm run -F docs test:local:unwatch
```

Important notes:
- Always ensure Supabase is running before tests
- Database must be reset to ensure clean state
- Use test:local:unwatch to run tests without watch mode
- Tests are located in apps/docs/**/*.{test,spec}.{ts,tsx}

examples:
- input: |
# Bad: Running tests without proper setup
pnpm run -F docs test
pnpm run -F docs test:local

# Good: Proper test execution sequence
pnpm supabase status
pnpm supabase start # if not running
pnpm supabase db reset --local
pnpm run -F docs test:local:unwatch
output: "Correctly executed docs tests with proper Supabase setup"

metadata:
priority: high
version: 1.0
</rule>
6 changes: 6 additions & 0 deletions .cursor/rules/unit-integration-testing.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
description:
globs: apps/studio/**/*.test.ts,apps/studio/**/*.test.tsx
alwaysApply: false
---
Make sure to follow the guidelines in this file to write tests: [README.md](mdc:apps/studio/tests/README.md)
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/packages/ui/ @supabase/design
/packages/shared-data/pricing.ts @roryw10 @kevcodez
/packages/shared-data/plans.ts @roryw10 @kevcodez
/packages/common/telemetry-constants.ts @4L3k51 @supabase/growth-eng

/apps/studio/ @supabase/Dashboard

Expand All @@ -17,5 +19,3 @@
/apps/studio/components/interfaces/Organization/BillingSettings/ @supabase/security
/apps/studio/components/interfaces/Organization/Documents/ @supabase/security
/apps/studio/pages/new/index.tsx @supabase/security

/apps/studio/lib/constants/telemetry.ts @4L3k51 @loong @pamelachia
15 changes: 11 additions & 4 deletions .github/workflows/ai-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -33,14 +36,18 @@ jobs:
with:
sparse-checkout: |
packages
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache: 'pnpm'
- name: Install deps
run: npm ci
run: pnpm i
- name: Type check
run: npm run typecheck
run: pnpm run typecheck
- name: Run tests
run: npm run test
run: pnpm run test
Loading
Loading