I am able to use hasura via graphql to get the access token using an external api. It's usable via graphql or rest. The problem is that I shouldn't store the token.. How can I use the first action as mutation( to get the token) and request another get using that token?
Asked
Active
Viewed 59 times
0
-
You should store the token. Otherwise you'll need to store the actual credentials to recover the token every time. Furthermore the result of a query cannot be directly piped into another query without another network round-trip. – Michel Floyd Jul 04 '23 at 14:18
-
I guess I can store the token. But how to do so inside an action since I have only access to the body of the response( the first request). And how to read the stored token from another action ?? – Sara Jul 04 '23 at 16:08
-
Please read https://stackoverflow.com/help/how-to-ask then refine your question. You're going to need to show your code so far and where you're stuck. – Michel Floyd Jul 04 '23 at 17:26
-
1. I have an action which cosumes a rest api and return the access_token inside a JSON object, it's a dead end and you can't remove the actionName and response from the body. 2. I want to store the response of that action( it is working fine) inside a field in table( I created it as json or jsonb since the response can't be changed to a simple string). But I still receive the same that query_root does not contain the first field of the json response. 3. I want to consume the stored json for another call in another action. I don't know how can I write hasura code.. it's in different parts.. – Sara Jul 05 '23 at 13:38