zf

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

schema_definition.ex (920B)


      1 defmodule Absinthe.Language.SchemaDefinition do
      2   @moduledoc false
      3 
      4   alias Absinthe.{Blueprint, Language}
      5 
      6   defstruct description: nil,
      7             directives: [],
      8             fields: [],
      9             loc: %{line: nil}
     10 
     11   @type t :: %__MODULE__{
     12           description: nil | String.t(),
     13           directives: [Language.Directive.t()],
     14           fields: [Language.FieldDefinition.t()],
     15           loc: Language.loc_t()
     16         }
     17 
     18   defimpl Blueprint.Draft do
     19     def convert(node, doc) do
     20       %Blueprint.Schema.SchemaDefinition{
     21         description: node.description,
     22         type_definitions: Absinthe.Blueprint.Draft.convert(node.fields, doc),
     23         directives: Absinthe.Blueprint.Draft.convert(node.directives, doc),
     24         source_location: source_location(node)
     25       }
     26     end
     27 
     28     defp source_location(%{loc: nil}), do: nil
     29     defp source_location(%{loc: loc}), do: Blueprint.SourceLocation.at(loc)
     30   end
     31 end