How to use Dgraph in an iOS App

Thank you for the feedback. Based on your response then, would something like the image below work? In words, from the iOS app, perform user authentication using whatever 3rd party login. If login is successful, send a request to a backend to create a JWT and use that JWT to perform queries to Dgraph.

My only question is how to refresh the token and monitoring if it has expired.