So, basically when you change your GOPATH, you’re changing the directory where all of your Go projects are going to be, except there’s only one Go project in that directory, i.e. the server. So you’ll have to change your GOPATH back for your other projects to work, sorry about that :(
However, with Go 1.1 we don’t need GOPATHS anymore (mostly) 🎉
Hey! Sorry for the late reply, I didn’t forget about you!
Anyway, here’s what some code might look like to do what you want.
Check out the comments. I didn’t run it, but going by the docs it’s roughly correct.
You’re right! The only thing the Go code does in this case is handle API calls, not serving up the UI at all. In fact, the node server that runs the UI is for development only. When you want to run this in production you’ll build the UI into a
dist folder and simply serve that statically to your clients. This does not mean they’d have to be hosted…
Try them again! In 16.4 they made refs a waaay simpler and easy you use, all you do is define the ref in your constructor using ‘createRef’ I believe and then you set the ref you want your DOM element to reference in your jsx below.
Thank you Adrián! Even I have trouble following that tip sometimes, I’m still kicking myself for not messing with hooks/16.7 yet! Another thing you might want to check out if you haven’t done see yet are refs. I really wish I added a section on them honestly ☹️
That was kind of my point with this article honestly, at least when I started out, I wasn’t exposed to these concepts and they totally flew under my radar. I tried to give enough information to give a good idea on what each topic was, but my main goal was to just bring up these concepts and have the reader do more of their own research to get a better understanding :)
In your resolver function, you pass in a ResolveParams struct which will contain the data you’re querying (should be ResolveParams.Args). From here you’d have to take whatever your args are and massage it into Mongo’s format.
Hopefully this helps, if not, I’ll try and get some time to spin up some code if you like :)