Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ralphql_generator

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ralphql_generator

  • 0.2.5
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Ralphql_generator

ralphql_generator an useful gem for generating GraphQL queries and mutations in Rails applications. With ralphql_generator, you can quickly and easily create queries and mutations based on your application's data model, freeing up your time to focus on more complex development tasks.

By using ralphql_generator, you can reduce the likelihood of typos and other errors that can occur when writing GraphQL queries and mutations by hand. Instead, you can generate the necessary code with a few simple commands and then customize it as needed to fit your specific requirements.

ralphql_generator's name is a playful reference to the lovable yet dimwitted character from The Simpsons, Ralph Wiggum. By leaving the simple tasks to Ralph, you can focus on the parts of your application that truly require your expertise and creativity.

ralph computing

Installation

Add this line to your application's Gemfile:

gem  'ralphql_generator'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install ralphql_generator

Usage

Queries Generators

$ rails generate gql YourModel

And it will create base files:

  • app/graphql/types/your_model_type.rb
  • app/graphql/resolvers/your_model_resolver.rb
  • app/policies/your_model_policy.rb
  • spec/fixtures/graphql/your_models.graphql
  • spec/graphql/queries/your_models_spec.rb and it add your_models_field into app/graphql/types/query_type.rb

Then now you just have to update your_model_policy.rb and update or remove xit in your_models_spec.rb to have a base type fetchable

Mutations Generators

$ rails generate gql_mutation YourMutation

And it will create base files: - app/graphql/mutations/your_mutation.rb - spec/graphql/mutations/your_mutation_spec.rb - spec/fixtures/graphql/mutations/your_mutations.graphql There is no magical here, juste generate base files, you have to create your own business logic inside

Development

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the ralphql_generator project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 18 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc