Hey everybody. Had a lot of help in the past on the prisma slack so I’m trying my luck again.
I have this application that has toys.
Each of the toys has a field, published, that has a boolean value.
So we have a query for getting a toy.
Like you can assume the toys with published true can be accused publicly without having a JWT token.
The situation at the moment is the following:
I have a JWT middleware that checks a token and return 401 when the token is not valid.
I can remove this middleware but then I have to check if the token is valid within each resolver except when a toy is published.
The express middleware is route based and graphQL is query based ( I think this is an important point)
So my question is: What is the best way to solve this?