Closed agarwalchaitanya closed 3 years ago
A DGS is basically also just a Spring Boot app. Although there are other good options, the easiest way is probably to use Spring Data. There is lots of documentation available here: https://spring.io/projects/spring-data, and there are lots of videos available online as well.
Since this isn't really a DGS question I'm closing the issue, but I hope this helps you get on track at least!
I'm not sure how to map schemas to data entities. A small example or a code snippet would help.
It depends on a lot of other choices in the tech stack. For example, there are many different frameworks for ORM (Object Relational Mapping), so it's not really possible to give a one-size-fits-all answer. You could use DGS codegen to generate Java classes from the GraphQL schema, and use something like spring-data-jdbc to map those to a database.
Got you. That should work. Thanks :)
Hi, Just started working with DGS and relatively new to Spring too. I wanted to connect a postgres db to persist data but am not sure how to. Any leads on this would be appreciated.