# Anyone thought of connecting Hasura to Discourse's Postgres database for a potentially more customised (or narrowed down) FE?

**URL:** <https://meta.discourse.org/t/anyone-thought-of-connecting-hasura-to-discourses-postgres-database-for-a-potentially-more-customised-or-narrowed-down-fe/149576>\
**Category:** Development\
**Created:** [April 28, 2020, 9:58am UTC](https://meta.discourse.org/t/anyone-thought-of-connecting-hasura-to-discourses-postgres-database-for-a-potentially-more-customised-or-narrowed-down-fe/149576 "2020-04-28T09:58:17Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![ManUtopiK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manutopik/32/169931_2.png) [@ManUtopiK](https://meta.discourse.org/u/ManUtopiK)\
**Post date:** [May 21, 2020, 1:14am UTC](https://meta.discourse.org/t/anyone-thought-of-connecting-hasura-to-discourses-postgres-database-for-a-potentially-more-customised-or-narrowed-down-fe/149576/6 "2020-05-21T01:14:50Z")

</div>

Thanks for yours replies.

I don’t master docker very well, but my problem is not here. As I can’t set a discourse dev environment, I don’t have database… Just this empty dump.

Anyway, I just pushed this dump in a heroku instance! So you can try it live 🙂  
Go to [this online graphiql](https://graphiql-online.com/graphiql), and set this endpoint:  
[https://discourse-hasura.herokuapp.com/v1/graphql](https://discourse-hasura.herokuapp.com/v1/graphql)  
You can play with it! There’s no admin password, so you can also do mutations and subscriptions…

> [@dnk8n](#):
>
> Almost all of the logic is done in Ruby land.

This is what I discovered when tested discourse on Hasura! All customs functions, triggers, computed fields… are defined in Ruby. Bad for portability 😕

> [@dnk8n](#):
>
> Another approach is using Hasura’s [remote schema functionality](https://hasura.io/docs/1.0/graphql/manual/remote-schemas/index.html) but to do that Discourse would need a GraphQL API, not REST… so also in itself not very helpful.

Not helpful, missing the discourse graphql api. But this is a powerful feature of Hasura. I use it a lot with a custom graphql of Stripe. If we got a discourse graphql API, we can plug it in our own graphql with remote schema!

> [@dnk8n](#):
>
> But there is the possibility to [wrap pre-existing REST APIs within a GraphQL layer](https://hasura.io/blog/create-a-remote-schema-to-wrap-a-rest-api-hasura/).

Yes, but we have to build all the schema and resolvers. A lot of work!  
I think it’s better to use the open api of discourse here: [https://docs.discourse.org/](https://docs.discourse.org/) (in the download button), and use it with a graphql generator like [https://graphql-mesh.com/docs/handlers/openapi](https://graphql-mesh.com/docs/handlers/openapi)  
I will try as soon as possible…

---

_[View the full topic](https://meta.discourse.org/t/anyone-thought-of-connecting-hasura-to-discourses-postgres-database-for-a-potentially-more-customised-or-narrowed-down-fe/149576)._
