zf

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

scalar_type_definition.ex (917B)


      1 defmodule Absinthe.Language.ScalarTypeDefinition do
      2   @moduledoc false
      3 
      4   alias Absinthe.{Blueprint, Language}
      5 
      6   defstruct name: nil,
      7             description: nil,
      8             directives: [],
      9             loc: %{line: nil}
     10 
     11   @type t :: %__MODULE__{
     12           name: String.t(),
     13           description: nil | String.t(),
     14           directives: [Language.Directive.t()],
     15           loc: Language.t()
     16         }
     17 
     18   defimpl Blueprint.Draft do
     19     def convert(node, doc) do
     20       %Blueprint.Schema.ScalarTypeDefinition{
     21         name: node.name,
     22         description: node.description,
     23         identifier: Macro.underscore(node.name) |> String.to_atom(),
     24         directives: Absinthe.Blueprint.Draft.convert(node.directives, doc),
     25         source_location: source_location(node)
     26       }
     27     end
     28 
     29     defp source_location(%{loc: nil}), do: nil
     30     defp source_location(%{loc: loc}), do: Blueprint.SourceLocation.at(loc)
     31   end
     32 end