SPA & Node implementation

Hi guys!

I have narrowed down my requirements for my current project and I am glad that auth0 can solve all kind of authentication problems! Please bare with me because this is my first post, so if I am doing anything wrong, let me know!

Why I am writing this is I want to know what guides are out there for my stack. I am using nextJS and apollo-server.

By now I have found this auth0 blog post and that auth 0 blog post. That posts seems pretty straight forward to me but they dont solve one fundamental problem I have.

My problem is that I have different roles for my customers, let´s say pro-customer and customer. As I am using graphQL I want to be able to retrieve the roles within every resolver from the current user context. So I am able to restrict access to different resolvers based on user.role.

Can you guys give me a hint how to implement this?

Thank you very much!