supabase / pg_graphql

GraphQL support for PostgreSQL
https://supabase.github.io/pg_graphql
Apache License 2.0
2.88k stars 101 forks source link

Data is being returned using Supabases's GraphiQL browser but not when I use the HTTP API #537

Closed patelc75 closed 3 months ago

patelc75 commented 3 months ago

Describe the bug Not sure if this a "bug" but data is being returned using Supabases's GraphiQL browser but not when I use the HTTP API

To Reproduce Click here

Expected behavior Click here

Screenshots Click here for code snippets

Versions:

alaister commented 3 months ago

Hi @patelc75,

By default the role used in the GraphiQL editor in the browser is the service_role, which will bypass your RLS policies. If you don't have any RLS policies no data will be returned by default. You can learn more about RLS here: https://supabase.com/docs/guides/database/postgres/row-level-security

Screenshot 2024-06-28 at 15 45 18
patelc75 commented 3 months ago

Hi @patelc75,

By default the role used in the GraphiQL editor in the browser is the service_role, which will bypass your RLS policies. If you don't have any RLS policies no data will be returned by default. You can learn more about RLS here: https://supabase.com/docs/guides/database/postgres/row-level-security

Screenshot 2024-06-28 at 15 45 18

@alaister RLS policy was indeed the issue thanks!