Class: Twenty::GraphQL::Mutation::SetRandomProjectColor
- Inherits:
-
GraphQL::Schema::Mutation
- Object
- GraphQL::Schema::Mutation
- Twenty::GraphQL::Mutation::SetRandomProjectColor
- Defined in:
- lib/twenty/server/graphql/mutation/set_random_project_color.rb
Instance Method Summary collapse
Instance Method Details
#resolve(project_id:) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/twenty/server/graphql/mutation/set_random_project_color.rb', line 10 def resolve(project_id:) project = Twenty::Project.with_pk!(project_id) project.update(color: project.random_color) {errors: [], project:} rescue => ex {errors: [ex.]} end |