Skip to content

Using authField as well as other methods #422

Answered by hayes
axhamre asked this question in Q&A
Discussion options

You must be logged in to vote

Edit: A new method t.withAuth has been added to help with this issue.

Unfortunately there isn't a good way to do this right now... I have tried to make plugins compatible as much as possible, but this is a feature that slipped through the cracks, and doesn't have a good way to work together. For now the best work around is to use t.prismaField with the auth option for what ever scopes you want to apply, and then use a type-cast on the context object when accessing it inside your resolver.

I am open to ideas on how this could work better. Unfortunately it isn't possible to just change the type for context automatically in any field builder method when the auth option is defined, and creati…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@axhamre
Comment options

@hayes
Comment options

@axhamre
Comment options

@hayes
Comment options

Answer selected by axhamre
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants