Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oslabs-beta/TorchQL
A tool to quickly generate GraphQL schemas and resolvers from a relational database
https://github.com/oslabs-beta/TorchQL
Last synced: 3 months ago
JSON representation
A tool to quickly generate GraphQL schemas and resolvers from a relational database
- Host: GitHub
- URL: https://github.com/oslabs-beta/TorchQL
- Owner: oslabs-beta
- License: mit
- Created: 2020-04-09T21:13:37.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T03:04:27.000Z (almost 2 years ago)
- Last Synced: 2024-06-30T21:55:24.549Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 21.5 MB
- Stars: 171
- Watchers: 5
- Forks: 2
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/team-reactype/ReacType/pulls)
![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)#
A developer tool to generate a GraphQL API from a known relational database.
#
## What Is TorchQL?
**TorchQL** is an open-source tool to assist developers in the migration from REST APIs to GraphQL.
It facilitates the task of exposing a GraphQL API over a relational database. In other words, **you
can use it to implement GraphQL in your application!** Just visit our website
[here](https://www.torchql.com/).Our developer tool introspects an existing PostgreSQL or MySQL database and generates and returns
GraphQL schema and resolvers. You can download these schema and resolvers to the desktop or let
TorchQL assemble them in a lightweight zip package in the context of a real GraphQL API. After
running your unzipped application, you can use
GraphQL Playground, a built-in
graphical interactive in-browser GraphQL IDE, to begin querying your database! You also have the additional option of opening up GraphQL Playground in your existing browser and testing your schema and resolvers immediately!
## How It Works
**TorchQL** elegantly uses the metadata extracted from an SQL database to generate GraphQL custom types,
queries, mutations, and resolvers. The schema and resolvers can be returned in either SDL or
programmatic format and are downloadable as a single desktop file. For experienced users,
**TorchQL** permits the custom editing of schemas and resolvers in the browser prior to download.For a PostgreSQL database, enter your database address in the input box. For a MySQL database, enter
your host, user, password, and database information. Then select either of the following formats for
your GraphQL schema and resolvers:- As Schema Definition Language or **SDL**
- As GraphQLSchema object or **Programmatic**Click the **Demo** button if you would to use an existing PostreSQL database.
After entering your information, a new screen should appear displaying all your schema and resolvers
properly formatted in a text editor.SDL Example
Programmatic Example
Click on the **Back** button to reenter your database information.
Click on the **Save** button to save your formatted schema and resolvers to the desktop.
Click on the **Save/Test** button to save your formatted schema and resolvers as a GraphQL server file in a folder on the desktop. See below for how you can test these schema and resolvers using GraphQL Playground.
Click on the **Test** button to open up GraphQL Playground in the browser and test your schema and resolvers right away!
## How to Test Your Saved Schema and Resolvers:
- **Unzip** package
- **Open** directory
- **Install** dependencies```bash
npm install
```- **Run** application
```bash
npm start
```Just follow the instructions in the console or enter
localhost:3000/playground in your
browser, and now you can begin querying your database!
## Contributing
TorchQL is currently in beta release. We welcome all contributions & pull requests!
## Authors
- **[Eric Tang](https://www.edtang.dev)** - [@edtang44](https://github.com/edtang44)
- **[Jimmy Chen](https://www.linkedin.com/in/jimchn/)** - [@jimchn](https://github.com/jimchn)
- **[Mark Fusco](https://www.linkedin.com/in/marklfusco/)** -
[@QuestionMark3](https://github.com/QuestionMark3)
- **[Sara Chang](https://www.linkedin.com/in/sara-chang/)** -
[@sarachang530](https://github.com/sarachang530)
- **[Zac Haluza](https://haluza.dev)** - [@zhaluza](https://github.com/zhaluza)## License
This project is licensed under the MIT License