0

I was experimenting with Postgraphile and it is a great tool to auto-generate the GraphQL API but I am still a little bit confused why should I use it. (P.S. I am not very experienced with GraphQL and PostgreSQL.)

Question 1: Can I think of it this way? Postgraphile generates the code(query, mutation, resolvers, schema, types) for a server and these code are the code that we are going to write anyways if we are not using Postgraphile?

Question 2: An example, a server receives a string James from the front end and I want to concat Bond to it before storing it in the db's full name column. How do I achieve this mutation? Am I going to need the makeExtendSchemaPlugin to merge my schema with the resolver in Postgraphile?

calvert
  • 631
  • 10
  • 33

1 Answers1

1

Question 1: Postgraphile generates the code(query, mutation, resolvers, schema, types) for a server and these code are the code that we are going to write anyways if we are not using Postgraphile

Correct. postgraphile will create CRUD operations that are optimized and many other features which otherwise you would need to implement.

Question 2: An example, a server receives a string James from the front end and I want to concat Bond to it before storing it in the db's full name column. How do I achieve this mutation?

You can create postgreSQL function and implement business logic. https://www.graphile.org/postgraphile/custom-mutations/

Saihaj
  • 496
  • 5
  • 13