Open Mike-Van opened 10 months ago
Does it work? Have you for any issues?
So when i tried to add filterSchema
it crashed the app, seems like it doesnt work with external
policy:
mode: 'external',
authContext(ctx): TAuthContext {
const { device, location, role, staff, token, venue } = ctx;
return { device, location, role, staff, token, venue };
},
filterSchema: true,
What error are you seeing? Are you seeing something like this? https://github.com/mercurius-js/auth/blob/main/lib/validation.js#L31
Atm, we don't support this, and to be fair this isn't called out in the docs - something we certainly add for sure!
Would you be interested in adding this caveat to the docs and/or potentially adding support for schema filtering with external policy mode?
@jonnydgreen Let me take this up. I did not think of externalPolicy. 👍
Hi i'm fairly new to Fastify and Mercurius, I'm trying to setup a graphql api project for 1 of my side project. I saw there's a documentation to filter schema for auth policy directive, n it works great, but for my use case i prefer to use the external auth policy, is there a way to make external policy work for schema filtering, as i might need to expose the graphql playground for potential authenticated users. Here's a minimal snippets of my setup: