Lighthouse: "Laravel GraphQL Gotchas" painpoints

Created on 30 Nov 2018  路  3Comments  路  Source: nuwave/lighthouse

So, I published an article yesterday about this package's pain points and was encouraged by the maintainer on Reddit to move them to an issue, so here they are:

  • @bcrypt order: Bcrypt runs before validation, rendering length validation rules unusable.
  • Checking against a specific model on a policy: I _think_ this one's documented, but it's still a big pain point because it means I can't use any of the Model mutation utilities and have to write everything by myself.
  • (Not in the article) Authentication middleware. @auth works great, but when I use the auth middleware to restrict access to logged-in users, it triggers the default login redirect breaking GraphQL. Maybe make a native auth middleware, or provide a workaround in the docs?

Most helpful comment

@m1guelpf appreciate the article and the issue here! Thanks for participating 馃憤

About the issue with @bcrypt: Can you please open a seperate issue for that? It really seems worth fixing. Just stick to the issue template so everything is nice an clear :)

Next, for the model policies, see #244. Open for PRs.

And lastly, well, i think re-using Laravel middleware is mostly a crutch. If you need proper spec conformant responses, you are better of using one of the built-in directives or implement your custom FieldMiddleware directive. I am willing to assist in that, if you promise to write up some docs about it. They are really easy to contribute to and the best place for your findings.

Closing this issue, hope i gave you a few hints on how to move forward.

All 3 comments

I didn鈥檛 get the point about your article ... Are you into Lighthouse?

This is open source. Instead of blogging about your complains you should collaborate by sending PR or opening issues with your suggestions.

It looks like he's complaining about some of the issues but in another case praising the authors. You can write a custom directive for the rud of crud. Instead of complaining just open a issue. They get to things pretty fast in my opinion. It's a open source project so I appreciate all the effort. They keep on improving it day by day.

Also follow the issue template so the issue can be understood better. It helps out the maintainers.

@m1guelpf appreciate the article and the issue here! Thanks for participating 馃憤

About the issue with @bcrypt: Can you please open a seperate issue for that? It really seems worth fixing. Just stick to the issue template so everything is nice an clear :)

Next, for the model policies, see #244. Open for PRs.

And lastly, well, i think re-using Laravel middleware is mostly a crutch. If you need proper spec conformant responses, you are better of using one of the built-in directives or implement your custom FieldMiddleware directive. I am willing to assist in that, if you promise to write up some docs about it. They are really easy to contribute to and the best place for your findings.

Closing this issue, hope i gave you a few hints on how to move forward.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spawnia picture spawnia  路  3Comments

caizhigang97 picture caizhigang97  路  3Comments

let-aurn picture let-aurn  路  3Comments

alexwhb picture alexwhb  路  4Comments

mehranabi picture mehranabi  路  3Comments