Persist REST API response data in the database, how?

This video explains nicely how:

In this tutorial, we will cover how to bring data from an external RESTful endpoint into a query response using Dgraph Lambda. This is great when you have existing or 3rd party RESTful services that contain data that you need in your GraphQL response but don’t want to persist in the database.

https://www.youtube.com/watch?v=YW913kNpc6U

My question how to go about when I DO want to persist the REST API response data in the database?

Hi @q0q0,

Are you saying that you want to populate the graph based on results of REST APIs at the same moment that you’re satisfying a query with a Lambda? Perhaps you could share a bit more detail on what exactly you’re trying to accomplish.

Hi @matthewmcneely , thanks for your quick reply. Sorry I was not clear.
Well, I aim to do a REST API call and that the reponse data will be stored persistently in my database. This to make relationships between nodes I created myself in the database and nodes that are response data from my REST API calls. So basically the same what is shown in the youtube video except for that fact that the responded data does get added to the database. Thanks again.

OK, maybe the lambda stuff is tripping you up. If you have a graph with a schema active, then writing a program in pretty much any language you choose that makes a REST API call to some other service can then easily add that returned data to your graph.

Maybe check out the clients section of the docs (https://dgraph.io/docs/clients/overview/). There are a number of Dgraph supported/recommended clients listed there. Note these are primary for DQL, not GraphQL. If you’re looking for GraphQL clients, then depending on the language you choose to write your REST API calling program, you’ll be able to find many GraphQL clients in open source.