116 karma · joined Sep 12, 2013 (13y ago) · 75 submissions
comment 7y ago · link · parent
Thanks for the feedback here. I modified the post a bit to not show the arrays because the library doesn't return arrays but rather aync generators. The power of this is that you have a single interface for interacting with all data no matter if there are zero or many results.
This is library is a proof of concept. In a perfect world, there would be a nice wrapper around this query result for interacting with the data.
queryResult.get('order').first()
This would provide a single order by calling the first yield for the generator. No need to worry about the underlying result.With all of this said, it doesn't have to be this way. I'm exploring ideas here. The important concept is that GraphQL can be used to express the expectations of the client and a library like Graphable JSON can go find the needed data in the API. This gives the expressiveness of GraphQL with the benefits of REST. The sky is the limit. Thanks again for the feedback!
2.
Using GraphQL with REST APIs(dev.to ↗)
3 points · by greencurry43 · 7y ago · 2 comments
3.
Terminal-based business card created from data on your site using npx(github.com ↗)
1 points · by smizell · 7y ago · discuss
comment 7y ago · link · parent
And the opposite is true, when I'm off work I'm off. My team can't treat me as always available because I'm remote. That takes time to establish.
Good point to mention.
comment 7y ago · link · parent
Also, protect your personal time. Do simple things, like mark out your lunch time on your calendar and don't let meetings creep into it—you'll be surprised how much this can help. Stop work at a time like 5pm and propose alternate times when people schedule things after it. People are usually open to moving meetings and may have not considered your stop time. Time zones make this harder as it's hard to keep track of when lunch is for people. Meetings during personal times should be exceptions.
Try to keep work things off your phone, though that's easier said than done with things like Slack or email. They make it too easy to work without feeling like you're working. I'm failing here currently :)
These above are all things you can do as an individual. But I think the success will also depend on your team. If you are the only remote person, it will be harder than if everyone is distributed. You'll need to ask people to write more and act like everyone is remote because you'll miss out. I've found that if you're the only remote person, it helps if your team works from home a day or two a week so they have to work remotely.
To summarize, set clear boundaries and expectations with yourself and your team with how and when you work and try to move your team to be remote-first.
7.
Test Coverage is a Lie(smizell.me ↗)
4 points · by smizell · 7y ago · 3 comments
8.
1 points · by smizell · 7y ago · discuss
comment 8y ago · link · parent
Another interesting read is around the configuration complexity clock [1], in that over time we move from hard coding things to building configurations to coming full circle and hard coding things again. I like to think internal DSLs closes that loop well.
[0] https://www.martinfowler.com/articles/languageWorkbench.html
[1] http://mikehadlow.blogspot.com/2012/05/configuration-complex...
comment 8y ago · link · parent
11.
Tree Branch – Create DSLs in JavaScript. Evaluate as Code. Serialize to JSON(github.com ↗)
2 points · by smizell · 8y ago · discuss
comment 8y ago · link · parent
13.
Geneva: Lisp as JSON with Lodash as Standard Library(github.com ↗)
3 points · by smizell · 8y ago · discuss
comment 9y ago · link · parent
In this video, he talks of a concept called functional core, imperative shell. The functional core is your code that contains your core logic that can be easily unit tested because it just receives plain values from the outside world. The imperative shell is the outside world that talks to disks, databases, APIs, UIs, etc. and builds these values to be used in the core. I'll stop there—Gary's video will do 100x than I can do here :)
15.
Introducing RESTful JSON(medium.com ↗)
5 points · by smizell · 9y ago · 1 comment
comment 9y ago · link · parent
Instead then of mapping CRUD operations to HTTP, you would map your application semantics to HTTP methods via link relations. Link relations let you go as far past CRUD as you would like to go depending on your domain and allow you to describe your states and state machine.
I always think a good way to think about a hypermedia state machine is in the context of HTML. Consider a todo app example. You might enter the application and get an empty list of todo items. If you have permissions to add a todo, you might have a "create todo" HTML form. Once you use that form, that todo has a new form called "mark complete." Once invoked, that todo has new transitions called "mark incomplete" or "archive." Once archived, you might see a new form for "unarchive." All of this captures the state machine and transitions in the REST API itself using domain-specific semantics.
Of course, there are other ways of solving this problem, but REST with hypermedia is a great way to work with state machines. There are lots of hypermedia JSON formats out there if you're interested in exploring (e.g. HAL, Siren, Collection+JSON, etc.).
comment 9y ago · link · parent
comment 9y ago · link · parent
[0] https://developer.github.com/v3/media/ [1] http://blog.steveklabnik.com/posts/2011-07-03-nobody-underst...
comment 9y ago · link · parent
An API version says to me that one day the entire API may introduce a major change that is separate from the current API. If you plan to never introduce a major change like this, you may not need a "/v1" in the URL.
Kudos to the author for putting together a nice article :)
comment 9y ago · link · parent
comment 9y ago · link · parent
While you can go back to day-to-date activities after a few days, there is still extra time to heal fully. Pain can hang around for a long time in some cases—even years. Infection is also a big concern, so take it should be taken very seriously.
With all of that said, a vasectomy is a much better and simpler option than female sterilization for a majority of people and has a high success rate.
comment 9y ago · link · parent
However, I'm not sure there is a definitive answer on if that's true from an HTTP perspective. I also couldn't find it in a skimming of the OpenAPI 3.0 spec.
In the end, REST [1] itself does not prescribe either condition and the HTTP 1.1 [2] spec doesn't either.
> A payload within a GET request message has no defined semantics; sending a payload body on a GET request might cause some existing implementations to reject the request.
[1] https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arc... [2] https://tools.ietf.org/html/rfc7231#section-4.3.1
29.
Thinking Through Hypermedia API Design(smizell.com ↗)
2 points · by smizell · 10y ago · discuss