Skip to content

Rails generator for scaffolding models with Graphql-Ruby

License

Notifications You must be signed in to change notification settings

arthurmolina/graphql_scaffold

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published