a field to know the invoker of the query/mutation's in ctx argument
I want a field in the
ctx
argument of the query / mutation to know about the invoker of the query/mutation
More specifically, I just need to know whether the invoker is the client or an internal function (internalQuery, internalMutation or internalAction)
MY USE CASE
I want to skip the auth check if the invoker is an internal function2 Replies
OR we can have a private argument
internal_payload
that is only allowed to be set by an internal function. By this way, we can pass info from the internal function to the query/mutation. Client cannot set this argument internal_payload
Thanks for the feature request! I'll bring it up with the team. In the meantime, you can construct this yourself:
split the called query/mutation into an internal version and a public version. From the internal version, call
myHelper(ctx, {...args, internal: true})
and from the public version call myHelper(ctx, {...args, internal: false})
. Then call the internal version only from internal mutations/actions. Public queries and mutations can be called from the client, so if you want a special flag if the caller is internal, the callee should also be internal.