Accessing the current ABAC user in a GraphQL resolver

Hi. I have ids that are unique within a given context–specifically, I’m working with Slack APIs in my current project, and conversation ids and other ids are unique within a given team.

I can make queries that require both a team id for context and another id for identification within that context. That’s ok. That’s why this is a feature request and not a request for help.

But (assuming I sort out everything from https://fauna.com/blog/abac-graphql, then…) a FaunaDB ABAC user will be associated with a given Slack team. I want GraphQL to be able to query easily with the user’s current context–their Slack team. For instance, I might want a query that is findConversationBySlackId(slackId: String!): Conversation . The search actually needs to use an index on both the slackId and the user’s current team, but the user shouldn’t have to worry with that.

That would be neat. (We can’t do that now, right?)

Hm, never mind, Identity() to the rescue. :blush:

2 Likes