How to use Dgraph in an iOS App

Yes, exactly.

You can wait to get an error for when the token expired from Dgraph when you make a request or you can decode it and look at the expiration in your app. To refresh your token that varies based upon what service you use for authentication. I believe firebase and auth0 both support refresh tokens. The basic premise is that when you authentocate you get a refresh token and then you use that refresh token to get a shorter lived token with your custom claims, you check in your app for the expiration and use the refresh token to get another short lived token all blindly to the user.