Closed jmparsons closed 7 years ago
I've followed the how to and am not able to get a good response. I can run the non serverless postgraphsql forum example just fine locally and query it using graphiql.
postgraphsql
My pg connection after sls deploy looks like this:
sls deploy
"config": { "PGCON": "postgres://example:serverless@MY_PG_ENDPOINT:5432/forumexample" },
And my YML:
environment: PGCON: postgres://example:serverless@MY_PG_ENDPOINT:5432/forumexample JWT_SECRET: keyboard_kitten
When I try to run graphiql using postgraphql-local or from the pgcon url using this query:
postgraphql-local
{ postById(id: 3) { id headline } }
yields:
{ "errors": [ { "message": "permission denied to set role \"forum_example_anonymous\"" } ] }
Same query with Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhIjoxLCJiIjoyLCJjIjozfQ.hxhGCCCmGV9nT1slief1WgEsOsfdnlVizNrODxfh1M8:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhIjoxLCJiIjoyLCJjIjozfQ.hxhGCCCmGV9nT1slief1WgEsOsfdnlVizNrODxfh1M8
{ "errors": [ { "message": "invalid signature" } ] }
Testing with a custom modified JWT Token I get (expected this):
{ "errors": [ { "message": "jwt audience invalid. expected: postgraphql" } ] }
My remote endpoint deployment response from going to /graphql is this:
{"errors":[{"name":"error","length":113,"severity":"ERROR","code":"42501","file":"guc.c","line":"9604","routine":"call_string_check_hook"}]}
@jmparsons How did you solve this?
I've followed the how to and am not able to get a good response. I can run the non serverless
postgraphsql
forum example just fine locally and query it using graphiql.My pg connection after
sls deploy
looks like this:And my YML:
When I try to run graphiql using
postgraphql-local
or from the pgcon url using this query:yields:
Same query with
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhIjoxLCJiIjoyLCJjIjozfQ.hxhGCCCmGV9nT1slief1WgEsOsfdnlVizNrODxfh1M8
:Testing with a custom modified JWT Token I get (expected this):
My remote endpoint deployment response from going to /graphql is this: