mobilizon/lib/graphql/schema/config.ex

51 lines
1 KiB
Elixir
Raw Normal View History

2020-01-26 20:34:25 +01:00
defmodule Mobilizon.GraphQL.Schema.ConfigType do
2019-03-22 10:53:38 +01:00
@moduledoc """
Schema representation for User
"""
use Absinthe.Schema.Notation
2020-01-26 20:34:25 +01:00
alias Mobilizon.GraphQL.Resolvers.Config
2019-03-22 10:53:38 +01:00
@desc "A config object"
object :config do
# Instance name
field(:name, :string)
field(:description, :string)
2019-03-22 10:53:38 +01:00
field(:registrations_open, :boolean)
field(:registrations_whitelist, :boolean)
field(:demo_mode, :boolean)
field(:country_code, :string)
field(:location, :lonlat)
field(:geocoding, :geocoding)
field(:maps, :maps)
end
object :lonlat do
field(:longitude, :float)
field(:latitude, :float)
field(:accuracy_radius, :integer)
2019-03-22 10:53:38 +01:00
end
object :geocoding do
field(:autocomplete, :boolean)
field(:provider, :string)
end
object :maps do
field(:tiles, :tiles)
end
object :tiles do
field(:endpoint, :string)
field(:attribution, :string)
end
2019-03-22 10:53:38 +01:00
object :config_queries do
@desc "Get the instance config"
field :config, :config do
resolve(&Config.get_config/3)
end
end
end