I have a use case where in I want to access query parameter/arguments in the directive. Following is the schema.
user(where: UserWhereUniqueInput!): User @isAuthenticated
Query that is fired from playground
user(where:{id: "test001"}){id name}
Directive code
isAuthenticated: async (next, source, args, ctx) => {
let user = ctx.prisma.context.user(where: {})// Need to fetch the user with given id
}
How can I fetch the user with given id in directives code. I did not get id in args
variable. Is there a way to get UserWhereUniqueInput
value in directive?