
Security News
Rspack Introduces Rslint, a TypeScript-First Linter Written in Go
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
This gem is used to generate a full GraphQL API using introspection of Mongoid or ActiveRecord models. After installing it, you will have create, update, delete, and query actions on any rails models you want.
This gem depends on the GraphQL gem.
Please install that gem first before continuing
Add this line to your Gemfile:
gem 'graphoid'
$ bundle install
Create the file config/initializers/graphoid.rb
And configure the database you want to use in it.
Graphoid.configure do |config|
config.driver = :mongoid
# or
config.driver = :active_record
end
You can determine which models will be visible in the API by including the Graphoid Queries and Mutations
class Person
include Graphoid::Queries
include Graphoid::Mutations
end
You can also include a special concern that will let you create virtual fields and forbid access to existing fields
class Person
include Graphoid::Graphield
graphield :full_name, String # virtual fields need to resolve as a method
graphorbid :balance # attribute balance will not be exposed in the API
def full_name
"#{first_name} #{last_name}"
end
end
You can find an example that uses ActiveRecord in the Tester AR folder and an example with Mongoid in the Tester Mongo folder of this same repository.
$ DRIVER=ar DEBUG=true bundle exec rspec
$ DRIVER=mongo DEBUG=true bundle exec rspec
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that graphoid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
Security News
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.