zf

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

list_value.ex (712B)


      1 defmodule Absinthe.Language.ListValue do
      2   @moduledoc false
      3 
      4   alias Absinthe.{Blueprint, Language}
      5 
      6   defstruct values: [],
      7             loc: nil
      8 
      9   @type t :: %__MODULE__{
     10           values: [Language.value_t()],
     11           loc: Language.loc_t()
     12         }
     13 
     14   defimpl Blueprint.Draft do
     15     def convert(node, doc) do
     16       %Blueprint.Input.List{
     17         items:
     18           node.values
     19           |> Enum.map(fn value ->
     20             %Blueprint.Input.RawValue{content: Blueprint.Draft.convert(value, doc)}
     21           end),
     22         source_location: source_location(node)
     23       }
     24     end
     25 
     26     defp source_location(%{loc: nil}), do: nil
     27     defp source_location(%{loc: loc}), do: Blueprint.SourceLocation.at(loc)
     28   end
     29 end