string_value.ex (556B)
1 defmodule Absinthe.Language.StringValue do 2 @moduledoc false 3 4 alias Absinthe.{Blueprint, Language} 5 6 defstruct [ 7 :value, 8 :loc 9 ] 10 11 @type t :: %__MODULE__{ 12 value: String.t(), 13 loc: Language.loc_t() 14 } 15 16 defimpl Blueprint.Draft do 17 def convert(node, _doc) do 18 %Blueprint.Input.String{ 19 value: node.value, 20 source_location: source_location(node) 21 } 22 end 23 24 defp source_location(%{loc: nil}), do: nil 25 defp source_location(%{loc: loc}), do: Blueprint.SourceLocation.at(loc) 26 end 27 end