type.ex (3927B)
1 # Zenflows is designed to implement the Valueflows vocabulary, 2 # written and maintained by srfsh <info@dyne.org>. 3 # Copyright (C) 2021-2023 Dyne.org foundation <foundation@dyne.org>. 4 # 5 # This program is free software: you can redistribute it and/or modify 6 # it under the terms of the GNU Affero General Public License as published by 7 # the Free Software Foundation, either version 3 of the License, or 8 # (at your option) any later version. 9 # 10 # This program is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU Affero General Public License for more details. 14 # 15 # You should have received a copy of the GNU Affero General Public License 16 # along with this program. If not, see <https://www.gnu.org/licenses/>. 17 18 defmodule Zenflows.VF.AgentRelationshipRole.Type do 19 @moduledoc false 20 21 use Absinthe.Schema.Notation 22 23 alias Zenflows.VF.AgentRelationshipRole.Resolv 24 25 @role_behavior """ 26 The general shape or behavior grouping of an agent relationship role. 27 """ 28 @role_behavior_id "(`RoleBehavior`) #{@role_behavior}" 29 @role_label """ 30 The human readable name of the role, from the subject to the object. 31 """ 32 @inverse_role_label """ 33 The human readable name of the role, from the object to the subject. 34 """ 35 @note "A textual description or comment." 36 37 object :agent_relationship_role do 38 field :id, non_null(:id) 39 40 @desc @role_behavior 41 field :role_behavior, :role_behavior, 42 resolve: &Resolv.role_behavior/3 43 44 @desc @role_label 45 field :role_label, non_null(:string) 46 47 @desc @inverse_role_label 48 field :inverse_role_label, :string 49 50 @desc @note 51 field :note, :string 52 end 53 54 input_object :agent_relationship_role_create_params do 55 @desc @role_behavior_id 56 field :role_behavior_id, :id, name: "role_behavior" 57 58 @desc @role_label 59 field :role_label, non_null(:string) 60 61 @desc @inverse_role_label 62 field :inverse_role_label, :string 63 64 @desc @note 65 field :note, :string 66 end 67 68 input_object :agent_relationship_role_update_params do 69 field :id, non_null(:id) 70 71 @desc @role_behavior_id 72 field :role_behavior_id, :id, name: "role_behavior" 73 74 @desc @role_label 75 field :role_label, :string 76 77 @desc @inverse_role_label 78 field :inverse_role_label, :string 79 80 @desc @note 81 field :note, :string 82 end 83 84 object :agent_relationship_role_response do 85 field :agent_relationship_role, non_null(:agent_relationship_role) 86 end 87 88 object :agent_relationship_role_edge do 89 field :cursor, non_null(:id) 90 field :node, non_null(:agent_relationship_role) 91 end 92 93 object :agent_relationship_role_connection do 94 field :page_info, non_null(:page_info) 95 field :edges, non_null(list_of(non_null(:agent_relationship_role_edge))) 96 end 97 98 object :query_agent_relationship_role do 99 @desc "Retrieve details of an agent relationship role by its ID." 100 field :agent_relationship_role, :agent_relationship_role do 101 arg :id, non_null(:id) 102 resolve &Resolv.agent_relationship_role/2 103 end 104 105 @desc """ 106 Retrieve possible kinds of associations that agents may have 107 with one another in this collaboration space. 108 """ 109 field :agent_relationship_roles, :agent_relationship_role_connection do 110 arg :first, :integer 111 arg :after, :id 112 arg :last, :integer 113 arg :before, :id 114 resolve &Resolv.agent_relationship_roles/2 115 end 116 end 117 118 object :mutation_agent_relationship_role do 119 field :create_agent_relationship_role, non_null(:agent_relationship_role_response) do 120 arg :agent_relationship_role, non_null(:agent_relationship_role_create_params) 121 resolve &Resolv.create_agent_relationship_role/2 122 end 123 124 field :update_agent_relationship_role, non_null(:agent_relationship_role_response) do 125 arg :agent_relationship_role, non_null(:agent_relationship_role_update_params) 126 resolve &Resolv.update_agent_relationship_role/2 127 end 128 129 field :delete_agent_relationship_role, non_null(:boolean) do 130 arg :id, non_null(:id) 131 resolve &Resolv.delete_agent_relationship_role/2 132 end 133 end 134 end