zf

zenflows testing
git clone https://s.sonu.ch/~srfsh/zf.git
Log | Files | Refs | Submodules | README | LICENSE

type.ex (1824B)


      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.InstVars.Type do
     19 @moduledoc "GraphQL types for instance-level, global variables."
     20 
     21 use Absinthe.Schema.Notation
     22 
     23 alias Zenflows.InstVars.Resolv
     24 
     25 object :instance_units do
     26 	field :unit_one, non_null(:unit), resolve: &Resolv.unit_one/3
     27 end
     28 
     29 object :instance_specs do
     30 	field :spec_currency, non_null(:resource_specification),
     31 		resolve: &Resolv.spec_currency/3
     32 
     33 	field :spec_project_design, non_null(:resource_specification),
     34 		resolve: &Resolv.spec_project_design/3
     35 
     36 	field :spec_project_service, non_null(:resource_specification),
     37 		resolve: &Resolv.spec_project_service/3
     38 
     39 	field :spec_project_product, non_null(:resource_specification),
     40 		resolve: &Resolv.spec_project_product/3
     41 end
     42 
     43 object :instance_variables do
     44 	field :units, non_null(:instance_units)
     45 	field :specs, non_null(:instance_specs)
     46 end
     47 
     48 object :query_inst_vars do
     49 	field :instance_variables, non_null(:instance_variables),
     50 		resolve: &Resolv.instance_variables/2, meta: [only_guest?: true]
     51 end
     52 end