No commit activity in last 3 years
No release in over 3 years
A good way to automatize graphql models
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

graphql scaffold graphql_scaffold

Build Status Gem Version GitHub

Rails generator for scaffolding models with GraphQL-Ruby.

Installation

Install from RubyGems by adding it to your Gemfile:

# Gemfile
gem 'graphql_scaffold'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install graphql_scaffold

Dependencies

The scaffolded graphql queries, mutations and subscriptions depend on:

  • SearchObjectGraphql >= 0.3
  • SearchObject >= 1.2.3
  • Graphql >= 1.9.5

Besides this you may need to run the following command to begin with Graphql:

$ rails generate graphql:install

Usage

If you have a model already created:

$ rails generate graphql_scaffold model_example

If you want to create a model and scaffold your Graphql API:

$ rails generate graphql_scaffold model_example field1 field2:integer field3

After this, you may need to run rails db:migrate. The format for fields are the same as rails generate model.

Example

Todo

  • Create subscription scaffold
  • Better tests

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Run the tests (rake)
  6. Create new Pull Request

License

MIT License