DEV Community

Discussion on: Reflecting on a year with Node.js and why I should have stuck with Laravel

circlecurve profile image

If rest api changes in sync that is your problem, I think you can take a look of graphql. GraphQL is a schema that define a standard of how the client communicate with your server. All api will consolidate with one url and data format is like a graph
Something like that

   user : 1 {
Enter fullscreen mode Exit fullscreen mode

If your server side schema change, your client don't need to worry about more calling more and more api.

Thread Thread
tylerlwsmith profile image
Tyler Smith Author

Thanks for the suggestion, CircleCurve!

I've used client-side GraphQL from a React app before. It was fine.

On the server, it sounds like it would add a lot of complexity outside of simple CRUD apps. REST API endpoints have a predictable code execution path and can be separated into distinct concerns. I don't know how that looks on the server for GraphQL, especially when performing validations, triggering side-effects, etc.

I know it's possible, and maybe it's easier than I'm thinking. It just feels like I'd be moving a lot of complexity from the front-end to the back-end, and since I'm already working on both, I don't see a big advantage.

If I were on a team of 20+ engineers with people only working on the front-end and only working on the back-end, GraphQL would be extremely appealing though.