DEV Community

Discussion on: What is GraphQL - the misconceptions.

Collapse
 
namsfromharlem profile image
Namkell • Edited

I’m confused with graphQL.... can u use it as a database... or does it filter database queries?
I am self taught...

Collapse
 
koresar profile image
Vasyl Boroviak • Edited

Hi mate.
Ask yourself, can you use HTML as a database?
Answer is no. Simply because it's a programming language.

Typically, a website or an app would send a GraphQL query to the server. The sever would see your query and would read the requested data from its database. And would return the data back to the website/app.

Collapse
 
paulcosma97 profile image
Paul Cosma

Html is not a programming language though

Collapse
 
genspirit profile image
Genspirit

It's an API specification which means in an interface that goes between a data source and a client to allow you and other developers to access it. It has a singular endpoint(url) that you send requests to, using GraphQL specific syntax. The GraphQL spec defines how that endpoint should interpret your request and ultimately resolve it(return data, or accomplish the requested task). Query requests will return information and Mutation requests will typically either change/create/update/delete information.

The other great benefit is that if you have multiple varying data sources you can use GraphQL to easily unify them under a singular endpoint. You just have to write the resolvers and connect them to the correct data sources.