More permanent way to fetch data through graphql api

Is there a way to get data from the graphql API in a more permanent way because the access token expires in 30 minutes. Or if there isn’t can anyone give a good way to use the refresh token and store it somewhere for 30 mins? Thanks