© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
12 replies
Alexander

Get empty response via GraphQL via CURL, but works in visual editor.

I'm trying to get a response from my database via the GraphQL interface. In the visual editor I run:

 {
  booksCollection {
    edges {
      node {
        id
        name
        author
      }
    }
  }
}
 {
  booksCollection {
    edges {
      node {
        id
        name
        author
      }
    }
  }
}


And I get the response:
{
  "data": {
    "booksCollection": {
      "edges": [
        {
          "node": {
            "id": "1",
            "name": "Harry Potter and the chamber of secrets",
            "author": "JK Rowling"
          }
        },
        {
          "node": {
            "id": "2",
            "name": "Grapes of wrath",
            "author": "John Steinbeck"
          }
        }
      ]
    }
  }
}
{
  "data": {
    "booksCollection": {
      "edges": [
        {
          "node": {
            "id": "1",
            "name": "Harry Potter and the chamber of secrets",
            "author": "JK Rowling"
          }
        },
        {
          "node": {
            "id": "2",
            "name": "Grapes of wrath",
            "author": "John Steinbeck"
          }
        }
      ]
    }
  }
}


However, trying to do this via CURL (following this part of the documentation: https://supabase.github.io/pg_graphql/supabase/)
curl -X POST https://MYPROJECTID.supabase.co/graphql/v1 \
    -H 'apiKey: MYAPIKEY' \
    -H 'Content-Type: application/json' \
    --data-raw '{"query": "{ booksCollection { edges { node { id, name, author } } } }", "variables": {}}'
curl -X POST https://MYPROJECTID.supabase.co/graphql/v1 \
    -H 'apiKey: MYAPIKEY' \
    -H 'Content-Type: application/json' \
    --data-raw '{"query": "{ booksCollection { edges { node { id, name, author } } } }", "variables": {}}'


I get the empty response

{"data": {"booksCollection": {"edges": []}}}%
{"data": {"booksCollection": {"edges": []}}}%


What am I doing wrong? I don't get it. I don't have any active RLS policy on my table.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

can I get USER_TOKEN via Curl on sign in?
SupabaseSSupabase / help-and-questions
4y ago
Empty array as response
SupabaseSSupabase / help-and-questions
4y ago
Trouble making functions via Editor
SupabaseSSupabase / help-and-questions
3y ago
Rest API get count using CURL
SupabaseSSupabase / help-and-questions
4y ago