What is GraphQL

What is GraphQL actually?? What is it used for?? Discuss about GraphQL in details. Is it similar like Java??

Is a Query Layer used as an API system - It is a data-agnostic API. And it is used in Dgraph as a native language. As it is similar to DQL, its implementation is relatively easy to be native.

No, it is similar to DQL, JSON structure.

Not sure what you wanna know exactly.

1 Like

See Aman’s answer bellow, might help you too.
Questions related to the usage of GraphQL

1 Like

Okay…Thanks a bunch…

GraphQL is referred to by many at Dgraph as the query layer, but specifically by design it is called a query language.

Before Dgraph, there hasn’t been anyone (that I am aware of) that has implemented this query language directly at a database level. The common practice was to add a layer on top of an existing database and use resolvers usual coded with javascript to fetch the underlying data that directly answers the query, or to create and update the underlying data in response to a mutation.

It was developed by Facebook as a replacement to the REST API layer. A rest API usually has the tendency to over fetch or under fetch data. With GraphQL you get exactly tye data you requested. Not more, not less (unless the data requested doesn’t exist). A well implemented GraphQL layer was fine tuned with the same principles to only touch the data that is needed to form the response that was requested.

Dgraph’s founder @mrjn decided to use GraphQL as the query language to talk directly to the database skipping the layer of resolvers. What they found as noted on Dgraph’s blog is that while GraphQL could serve as a query language it was missing much functionality that was needed at the database level for a complete query language. So the Dgraph team developed their own query language and termed it graphql± (I read it as graphql more or less). After a few short years and the rise of GraphQL ease of use and to provide a better UX, the Dgraph team brought in @michaelcompton to lead the development of self generating the much envied GrqphQL layer that so many third party tools have been built around and is becoming an industry standard. Dgraph developed this not as another layer but into the core of the database. Yes a GQL (GraphQL) request does get translated into a DQL (the new less confusing name of graphql±) but it is not done so as another layer but as a built in function process.

2 Likes

Thanks for your reply… I am slowly getting an idea of what is GraphQL…

You may find this link helpful about GraphQL: https://www.howtographql.com/basics/0-introduction/

What Dgraph has done recently is really incredible, see this post: Back to GraphQL: Dgraph’s Life-long Journey with GraphQL - Dgraph Blog

2 Likes

Thanks a bunch… It was much helpful…