PostGraphQL: PostgreSQL meets GraphQL
I tried applying GraphQL to standard webapp&#x2F;services projects, and could not get really far. Maybe I&#x27;m missing something, help is appreciated.<p>GraphQL lets consumers (Web UIs, Mobile Apps etc) define the shape of data they want to receive from a backend service. Theoretically, this is awesome since at the time of writing the backend service you don&#x27;t always know which fields and relationships a consumer might require. The problem arrives when you add security. There are plenty of things that a client is not supposed to see, often based on the roles of the requesting user. That means that you can&#x27;t pass a GraphQL query directly to an underlying DB provider without verifying what is being requested. You&#x27;d end up writing about the same amount of code that you&#x27;d have written with a standard REST-style (or other) interface.<p>I also considered using it for Server to DB data fetches, where my backend Web Service would request an underlying GraphQL aware driver for some data. I did not find it particularly more expressive than using SQL or using an ORM.<p>One good thing about GraphQL is that it sort of formalises the schema and the relationship between entities. You could perform validations on incoming query parameters and mutations. It also helps clients understand the underlying schema and would serve as excellent documentation. This might be useful, but a REST API also offers some level of intuitiveness, and ORMs (especially in strongly-typed languages) offer some level of parameter and query validation.<p>These are probably early days, but it&#x27;d be nice to see some real world use cases for GraphQL which lie right in the middle of simple todo-list type of apps, and the unique needs of FaceBook.