GraphQL with Laravel | Lighthouse
GraphQL simply replaces your typical restful api endpoints
Edges and Nodes
GraphQL uses this concept "Edges" and "Nodes". This relates to Graph theory. Think of edges and nodes as the different fields to Collections or Arrays.
I don't yet understand when you need to add
edge
andnode
in your query
Directives
Directives in Lighthouse map to Laravel functionality. For example, the @all
directive will map to something like User::all()
in Eloquent.
Thoughts
Overall after going through the first few videos of the Laracast series and looking at the codebase more, I am starting to get a better handle on how this all works. At least at an entry level.
Helping our intern with an unfamiliar npm error
The error he is receiving is CERT_HAS_EXPIRED
. This is not one I've encoutered before.
One of the packages was resolving this registry https://registry.npm.taobao.org which did not have a valid SSL cert. Not sure why or how this happened
honestly. https://registry.npm.taobao.org/which-module/download/which-module-2.0.0.tgz
But I found this Stackoverflow thread of someone who had the same exact issue.
It also turned out later that he was using node v20 and the project should have been run using node v14. That project had a .nvmrc
file that allowed
us to quickly determine which version we should in fact be using.
Things we initially tried prior to discovering the weird registry url issue
npm cache clean --force
npm config set registry https://registry.npmjs.org/