I love talking about GraphQL, especially with people who have been working with GraphQL or thinking of adopting GraphQL. One common question peop...
For further actions, you may consider blocking this person and/or reporting abuse
I’m confused with graphQL.... can u use it as a database... or does it filter database queries?
I am self taught...
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.
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.
Html is not a programming language though
I don't see how using one endpoint for all your requests is a plus. Of course it's more convenient for the frontend Dev because they don't have to remember all the endpoints but this convenience comes with performance issues like:
Another benefit of graphql is having to perform a single server call, with REST you probably would make a lot of calls to the different endpoints.
It's costs way more to make a request to a server far away (tens of ms) than to parse a request (< 1 ms)
Great post, thank you for sharing. I'm a little confused about the myth "GraphQL is a database language like SQL." SQL is also a programming language, and more specifically a query language that is defined by a spec with many implementations of it. Is the distinction for this myth that GraphQL can be used on the frontend?
Hello friends.
I'm going to implement a Graphql API with NodeJS (for GraphQL server will use graphql-yoga or appolo), but my Database it will be MSSQL, could you suggest my any ORM, because Prisma support only Postgre and MySQL. I've seen Knex which support most of the DB's but is there any better than it?\
Kind Regards
Hi, I'm used Hasura GraphQL API that wraps Postgres database, it's good example of how you can use GraphQL with SQL database, easy to use, ready for work in a short time
Thanks for sharing! Hopefully this clarifies some misconceptions about GraphQL for those debating adoption.