https://github.com/hashrocket/graphql_way_rails
This is a Proof of Concept Rails project using GraphQL
https://github.com/hashrocket/graphql_way_rails
Last synced: about 1 year ago
JSON representation
This is a Proof of Concept Rails project using GraphQL
- Host: GitHub
- URL: https://github.com/hashrocket/graphql_way_rails
- Owner: hashrocket
- Created: 2020-04-03T18:44:25.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-19T19:00:17.000Z (over 3 years ago)
- Last Synced: 2025-03-27T14:21:18.775Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 1.13 MB
- Stars: 6
- Watchers: 5
- Forks: 1
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README
This is a Proof of Concept Rails project using Graphql. This was mainly created for these blog posts:
- [GraphQL Way - Rails Edition]
- [GraphQL Way - Limited Edition]
# Main Features
- Ruby on Rails setup with GraphQL
- DataLoaders for fetching data in batch
- BelongsToLoader
- HasManyLoader (works for has_many through relations as well)
- All main models are connected
- All main models are exposed as root query
- In any level of a GraphQL request (query), you can:
- Filter
- Sort
- Paginate
- RSpec tests for the GraphQL requests
# Data Models
This app has a very limited version of a regular e-commerce data modeling with:
- Category
- Product
- Order
- User
This simple data model will work as a common base for this Proof of Concept.
# Development
This is a regular Rails app, so you can just:
```shell
rails db:create db:migrate db:seed
rails server
```
Then you can use your prefered GraphQL tool pointed to: http://localhost:3000/graphql
You can also use the built in [GrapiQL]
[GraphQL Way - Rails Edition]: https://hashrocket.com/blog/posts/graphql-way-rails-edition
[GraphQL Way - Limited Edition]: https://hashrocket.com/blog/posts/graphql-way-limited-edition
[GrapiQL]: http://localhost:3000/graphiql