
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
graphql-mutable_type
Advanced tools
GraphQL::MutableType is an extension to GraphQL::ObjectType that adds the ability of having nested mutation queries. It defines as following:
type Fish {
id: String
name: String
Price: Float
inStock: Int
mutation: [FishMutation]
}
type FishMutation {
update: [UpdateFishMutation]
sell: [SellFishMutation]
}
And can be queried as following:
query {
fish(id: "1") {
id
name
price
mutation {
sell(weight: 100) {
inStock
}
}
}
}
As working with Facebook's practice of GraphQL, we have found that the mutations are all top level children of "mutation". This keeps us using global mutation names look like "SellFish", "UpdateFish". While all the models and services are coded in the OO way, the organization of mutations reminds me of days with out OO: some structs and a large set of functions that operate on the structs.
So we tried to reorganize the mutations under the Object Type itself, whick looks more like the way models we define our models.
This gem provides a DSL that helps define the types with mutations inside.
Just warp your mutations in mutation do ... end
.
KingType = GraphQL::MutableType.define do
name 'King'
description 'The title of the ruler of the kingdom'
field :id, !types.ID
field :name, !types.String
mutation do
field :rename, field: RenameKingField
end
end
See alse: test schema
This gem is released under the MIT License
FAQs
Unknown package
We found that graphql-mutable_type 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
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.