I'm evaluating Postgraphile for a small experiment and was trying to add an implicit where condition to the generated SQL query for all the query operations based on the resolver context (for example, something like, where(user_id = context.user_id).
I tried searching docs for a way to access queryBuilder in a resolver so I can do something like
queryBuilder.where(sql.query`user_id = ${sql.value(context.user_id)}`);
but I did not find a way after searching for a lot of time. I'm sure there's a way - I just couldn't find it. Can anyone just point me in the right direction or just paste a link to the documentation? Thanks!
I already know that we can use RLS policy to add this condition but I have a complex where condition based on business logic that'd I'd like to write in Node.js