hasura / hasura/graphql-engine

role-based schema prefix for multi-tenancy apps

Open
#3,606 18 comments 30 reactions 1 assignee Claimed by @daniel-chambers View on GitHub
a/api/graphql c/creating-schema c/server k/ideas
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

Hi, we're currently exploring ways to add a GraphQL API to our existing SaaS multi tenant application. We currently use postgres schemas to isolate our clients and each client has identical tables, etc. in their schema. For example

myapp (database)
- client1 (schema)
- users (table)
- products (table)
- client2 (schema)
- users (table)
- products (table)

All tenants share the same code base and the code simply does a `SET search_path ` to select the schema based of the subdomain, e.g client1.myapp.com.

Hasura looks amazing but we're not really sure how we can replicate this functionality as it seems to fail at the first hurdle. When we go to track our existing tables it's populating them with the tenant name (e.g client1_users, should just be users) and we're not sure how to perform this transparent schema switching.

Is there any way we can accomplish this with Hasura? We'd really love to use this project!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.