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