Fast Prototyping with Lighthouse Laravel

  • Let's say if you want to create a record, just define a schema and action in the same line as this and it will create a model no need to create separate routes, controllers, requests for this.
type Mutation {
createPost(title: String!): Post @create
}
type Query {
posts: [Post!]! @paginate
}
  • Most of the time we spend time documenting the Apis. With Lighthouse they provide default Playground for testing your API along with the documentation of yours schemas.
  • If you feel like you need a custom way around for your requirements. Extending is easy all you need to do is create a Resolver i.e (mutation or query) it acts as a controller like we used to do.

Conclusion

If you haven't worked with Graphql yet this could be a fun approach to know the Graphql mechanism. And if you have already tried it let me know your thoughts!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store