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