zf

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

type.ex (1707B)


      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.File.Type do
     19 @moduledoc "GraphQL types of Files."
     20 
     21 use Absinthe.Schema.Notation
     22 
     23 alias Zenflows.File.Resolv
     24 
     25 object :file do
     26 	field :hash, non_null(:url64)
     27 	field :name, non_null(:string)
     28 	field :description, non_null(:string)
     29 	field :date, non_null(:datetime), resolve: &Resolv.date/3
     30 	field :mime_type, non_null(:string)
     31 	field :extension, non_null(:string)
     32 	field :size, non_null(:integer)
     33 	field :signature, non_null(:string)
     34 	field :width, :integer
     35 	field :height, :integer
     36 	field :bin, :base64
     37 end
     38 
     39 input_object :ifile, name: "IFile" do
     40 	field :hash, non_null(:url64)
     41 	field :name, non_null(:string)
     42 	field :description, non_null(:string)
     43 	field :mime_type, non_null(:string)
     44 	field :extension, non_null(:string)
     45 	field :size, non_null(:integer)
     46 	field :signature, non_null(:string)
     47 	field :width, :integer
     48 	field :height, :integer
     49 end
     50 end