Search code examples
graphqlsupabase

Supabase Graphql Unexpected param or filter missing operator


When trying to execute a graphql query for my Supabase application, I get back the following error. Note that I have removed my api key from the response.

{
  "code": "PGRST104",
  "details": "Failed to parse [(\"apikey\",\"<my-api-key>\")]",
  "hint": null,
  "message": "Unexpected param or filter missing operator"
}

The query I'm running is pretty basic, and works correctly when running it through the Supabase GraphiQL editor. I've included the query below.

query MyQuery {
  flavourCollection {
    edges {
      node {
        id
      }
    }
  }
}

I'm making these calls to the https://<project-id>.supabase.co/graphql/v1?apikey=<my-api-key> uri. Also at this point I'm using the headers below when making calls to Graphql.

{
 "content-type": "application/json",
 "Authorization": "Bearer <my-api-key>"
}

Does anybody know what might be causing this issue?


Solution

  • Turns out that if I provide the apikey via the headers, it succesfully returns the correct response. Strange thing is though, I'm pretty sure passing the apikey via the url params used to work as well. Below I've included the correct url and headers.

    url: https://<project-id>.supabase.co/graphql/v1

    {
     "content-type": "application/json",
     "Authorization": "Bearer <my-api-key>"
     "apikey": "<my-api-key>"
    }