You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically: you use the graph-based nature of GraphQL to start at the current user, and then navigate from there to the related orders. You can add a field representing the current user via a database function as Daniel shows, or you can use makeExtendSchemaPlugin along with additionalGraphQLContextFromRequest (v4) or preset.grafast.context (v5) to add the relevant user ID to the context so that it can be used in your resolver (v4) / plan resolver (v5).
If you're really set on not using RLS at all (which I don't think is your question, but just in case), check out https://github.com/benjie/v5-auth-poc which is V5 only and highly experimental (not supported at all - it even needs a patch (included) to work currently).
[semi-automated message] To keep things manageable I'm going to close this issue as I think it's solved; but if not or you require further help please re-open it.
Summary
I want to fetch only the rows contain their respective user_id. In the condition i want to access the user_id from context. Like below without RLS
Additional context
The text was updated successfully, but these errors were encountered: