argument.ex (737B)
1 defmodule Absinthe.Language.Argument do 2 @moduledoc false 3 4 alias Absinthe.Blueprint 5 6 defstruct name: nil, 7 value: nil, 8 loc: %{} 9 10 @type t :: %__MODULE__{ 11 name: String.t(), 12 value: %{value: any}, 13 loc: Absinthe.Language.loc_t() 14 } 15 16 defimpl Blueprint.Draft do 17 def convert(node, doc) do 18 %Blueprint.Input.Argument{ 19 name: node.name, 20 input_value: %Blueprint.Input.RawValue{ 21 content: Absinthe.Blueprint.Draft.convert(node.value, doc) 22 }, 23 source_location: source_location(node) 24 } 25 end 26 27 defp source_location(%{loc: nil}), do: nil 28 defp source_location(%{loc: loc}), do: Blueprint.SourceLocation.at(loc) 29 end 30 end