# The Discourse API in GraphQL

**URL:** <https://meta.discourse.org/t/the-discourse-api-in-graphql/41183>\
**Category:** Development\
**Created:** [17 Marzo 2016, 9:24am UTC](https://meta.discourse.org/t/the-discourse-api-in-graphql/41183 "2016-03-17T09:24:22Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![debergalis](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/debergalis/32/121723_2.png) [@debergalis](https://meta.discourse.org/u/debergalis)\
**Post date:** [17 Marzo 2016, 6:43pm UTC](https://meta.discourse.org/t/the-discourse-api-in-graphql/41183/10 "2016-03-17T18:43:42Z")

</div>

Maaaaaybe. You still have O(lg n) roundtrips to a “normalized” REST API to  
get a tree of data.

The other thing is GraphQL opens up a number of other valuable  
optimizations. Projections on the server (clients don’t fetch fields they  
don’t need) and fine-grained caching (clients don’t have to refetch data  
they already have). These aren’t possible in any reasonably generic /  
composable way over REST.

> **···**
>
> On Thu, Mar 17, 2016 at 11:36 AM, Robin Ward wrote:
> 
> > eviltrout [https://meta.discourse.org/users/eviltrout](https://meta.discourse.org/users/eviltrout) Robin Ward  
> > [https://meta.discourse.org/users/eviltrout](https://meta.discourse.org/users/eviltrout) co-founder  
> > March 17
> > 
> > debergalis:
> > 
> > I think this is as true today as ever.
> > 
> > With HTTP2 though, this is significantly less of a problem!
> > 
> > ## Reply to this email to respond
> > 
> > ## In Reply To debergalis [https://meta.discourse.org/users/debergalis](https://meta.discourse.org/users/debergalis) matt debergalis [https://meta.discourse.org/users/debergalis](https://meta.discourse.org/users/debergalis) customer March 17 I think this is as true today as ever. The problems are 1) it’s now much more common to have multiple clients with different features / data needs; and 2) people are excited about microservices, but it’s hard to break a backend into separate parts without losing these optimized APIs.
> > 
> > Reply to this email to respond

---

_[View the full topic](https://meta.discourse.org/t/the-discourse-api-in-graphql/41183)._
