Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ah cool! I hadn't seen this before!

I'd only seen fairly raw GraphQL from like 4-5 years ago, when you had to write your own auth, resolvers, deal with n+1 queries, etc. This is actually really nice and solves a lot of the issues I was thinking of.



Right. People keep telling me that code-first is better but there is no way all those complex APIs are easier to use than just spitting out some JSON from an endpoint.

Schema-first feels more manageable.

I'm not going to say I haven't had to do that a _bit_ here, when I've got into quite advanced things.

(e.g. sometimes you might want to dynamically provide the values from an enum, or write your own decorators, or you might want a custom top-level resolver.)

It's built on the WebOnyx reference implementation, so there's some help out there.

But it's amazing how much code I haven't had to write, and being the sort of person I am with difficulties controlling focus, I absolutely love the schema-first approach. It interacts well with Eloquent scopes, with the ordinary API gate system, with policies and validations.

It's actually weird how good it is. You still have all the same issues you have with GraphQL generally (like limiting graph traversals to things a user is authorized to see), but you have so many tools.


Another nice thing about schema-first is that clients can start interacting with a mock server from day-0, and both sides can build out the implementation independently according to the spec. It really speeds things up on larger projects (IMHO).

Working on FrankenPHP, we get a lot of issues from the Laravel people (mostly in regards to octane + worker mode), and I've been getting into more and more Laravel to support these folks and understand what is going on in the SAPI. I've really started to understand the attraction lately. Previously, I worked at Automattic for quite a while and learned the WordPress side of PHP, then worked with Symfony in a corporate setting, so I've yet to get into Laravel in the commercial world, but I'm thinking I probably will for my next job.


Also: I have removed the little bit of snark in my reply above -- it shouldn't have been there and I apologise. Rough brain-day making me jumpy but there's no excuse!


Dude. We've all been there, no offense taken. I probably could have taken a few seconds to explain my experience instead of just assuming everyone else has had the same experience.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: