-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support custom jwt claims in postgraphile handler. #3913
Comments
An alternative to this would be support & docs to easily implement custom handlers, so I could just copy the postgraphile handler and add my own settings to it for less common settings like jwt claims. |
I ended up solving this for myself temporarily by copying the postgraphile handler, and adding my own pgSettings and publishing it as a private npm package. Not very clean and it already broke once due to other graphql mesh packages I had to rebase on. But at least there's a workaround for now. |
Is your feature request related to a problem? Please describe.
I was able to get the postgraphile handler working with our CRM without any issues. But I hit a wall when it came to the RLS (row level security) and JWT claims. There does not seem to be any way to change or add claims to postgraphile (even with the postgraphile options when it's run in schema mode).
This is a blocker for us to use an unmodified version of graphql-mesh
Describe the solution you'd like
graphql-mesh should add an optional function or static object to the postgraphile handler options called
pgSettings
which takesmeshContext
as the parameter.I was able to get postgraphile in graphql-mesh working for us, by editing this file:
node_modules/@graphql-mesh/postgraphile/index.js
These are the lines I changed to get it to work:
Describe alternatives you've considered
When using postgraphile builder for schema usage there it does NOT allow
pgSettings
to be passed to builder options which is the only one that's possible to edit fromgraphql-mesh
settings right now.https://www.graphile.org/postgraphile/usage-schema/
Additional context
To get this working we either have to fork
graphql-mesh
or write a hacky script that insets the function in inwithPostGraphileContext
to add in pgSettings.Please consider allowing users to add their own settings or overrides here.
The text was updated successfully, but these errors were encountered: