6 ms·
For a fun hack-week project I created a graphql server that would automatically create any necessary SQL tables to support a query given to it. So if you made t
by zwkrt 6y ago
For a fun hack-week project I created a graphql server that would automatically create any necessary SQL tables to support a query given to it. So if you made the query
query {
user {
name
email {
primary
secondary
}
posts {
body
karma
}
}
}
It would create an entire database schema with users, emails, and posts, and the correct indexes and fk relations to support the graphql query. It would also generate mutations for updating the entities in a relational, cascading manner, so deleting a user would also delete their email and posts.