简体   繁体   中英

GraphQL and Hibernate (ORM)

I have developed a spring web app using mysql as database and hibernate as the orm tool.

Then I came across GraphQL which apparently according to my googling, I found it is used to retrieve and persist data into database in a much simpler way [using an object structure].

My question: Is GraphQL an alternative to hibernate ?

And should I use GraphQL instead of hibernate (do I benefit from it?)?

GraphQL and Hibernate can be used together but are totally different concepts:

GraphQL is a query language where the client can choose from the meta model what to query and how the result should look.

Hibernate on the other hand is classical ORM.

It depends on your use case which to choose or you can also integrate both.

There is an example implementation on GitHub: https://github.com/graphql-java/graphql-java-examples/tree/master/hibernate-example

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM