
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
graphql-models_connect
Advanced tools
A way to directly link GraphQL types with their underlying models.
Add this line to your application's Gemfile:
gem 'graphql-models_connect', '~> 1.0'
And then execute:
$ bundle
GraphQL Models Connect associates every GraphQL type with a model. By default, the model is assumed to have the same name as the type minus the Type
suffix, and to be nested under the same module. For a single exception you can explicitly declare the model inside your object type:
module Types
class PokemonType < BaseObject
model_class Pokemon
...
end
end
To change the default behavior of the gem, override the default_model_class
class method in your base object class:
module Types
class BaseObject < GraphQL::Schema::Object
def self.default_model_class
model_name = name
.delete_prefix('Types::')
.delete_suffix('Type')
const_get model_name
end
end
end
The same methods are defined for interfaces.
GraphQL Models Connect loosely follows Semantic Versioning, with a hard guarantee that breaking changes to the public API will always coincide with an increase to the MAJOR
number.
Version numbers are in three parts: MAJOR.MINOR.PATCH
.
MAJOR
. There may also be changes that would otherwise increase the MINOR
or the PATCH
.MINOR
. There may also be changes that would otherwise increase the PATCH
.PATCH
.Notice that any feature deprecated by a minor release can be expected to be removed by the next major release.
Full list of changes in CHANGELOG.md
Bug reports and pull requests are welcome on GitHub at https://github.com/moku-io/graphql-filters.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that graphql-models_connect demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.