3 ms·
One of my problems with GraphQL APIs is that the consumption of that API because really difficult for simple tasks. With a traditional API wrapper there will us
by OhSoHumble 5y ago
One of my problems with GraphQL APIs is that the consumption of that API because really difficult for simple tasks. With a traditional API wrapper there will usually be a fetchResource() function that wraps the API call for getting a resource with function parameters mapping to HTTP query parameters usually.
With GraphQL I need to look up what specific query I need create to fetch a specific resource. It makes it harder to build quick, one off tools and scripts. Using GitHub's GraphQL API is what I specifically have in mind while I'm typing this.
- acidbaseextract 5y agoI think the GitHub GraphQL API docs are particularly badly organized and basically show the API as a bucket of stuff, rather than as CRUD entities (which is how it's actually organized). I don't think this a GraphQL issue.
- tomnipotent 5y agoYou have the exact same amount of work regardless of the two, which is reading the documentation. At least with GraphQLi, I can write a query with the docs open and iteratively explore.
- OhSoHumble 5y agoAnecdotally, the experience is much easier when it's a REST API. If all I want is to fetch one object and its metadata... then I look up the function and call it. If it's graphql then I have to... well, step one I have to learn the query language. And then I have to construct the query to return the data. It's not, like, super hard to go through all of that but it's extra cognitive burden that I don't want to deal with. I'm currently writing CLI tools in Go and have to use the graphql API for github because it offers data that the REST API does not (I think). I really prefer the REST API wrapper.
- joe_g_young 5y agoI am on my fourth rewrite on my in house web application. I am using ruby’s Sinatra with react as the front end. Including graphql in my front end and back end was easy. Querying the api was made easier with the “GraphiQL” app
- tomnipotent 5y ago> If all I want is to fetch one object and its metadata... then I look up the function and call it. ... it's literally the exact same thing for GraphQL. I open up GraphQL explorer, look at one root query I'm interested in, and fire off a request. It's really no different a workflow in Postman/Insomniac if I'm working with a GraphQL or REST API.