Add address input and refactor federation stuff

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-07-30 10:35:29 +02:00
parent bcfc26ee59
commit 5fbaf42cad
34 changed files with 729 additions and 192 deletions

View File

@@ -14,6 +14,7 @@ defmodule MobilizonWeb.Schema.AddressType do
field(:region, :string)
field(:country, :string)
field(:description, :string)
field(:url, :string)
end
object :phone_address do
@@ -26,10 +27,25 @@ defmodule MobilizonWeb.Schema.AddressType do
field(:info, :string)
end
input_object :address_input do
# Either a full picture object
field(:geom, :point, description: "The geocoordinates for the point where this address is")
field(:floor, :string, description: "The floor this event is at")
field(:street, :string, description: "The address's street name (with number)")
field(:locality, :string, description: "The address's locality")
field(:postal_code, :string)
field(:region, :string)
field(:country, :string)
field(:description, :string)
field(:url, :string)
end
object :address_queries do
@desc "Search for an address"
field :search_address, type: list_of(:address) do
arg(:query, non_null(:string))
arg(:page, :integer, default_value: 1)
arg(:limit, :integer, default_value: 10)
resolve(&Resolvers.Address.search/3)
end

View File

@@ -22,7 +22,7 @@ defmodule MobilizonWeb.Schema.EventType do
field(:begins_on, :datetime, description: "Datetime for when the event begins")
field(:ends_on, :datetime, description: "Datetime for when the event ends")
field(:status, :event_status, description: "Status of the event")
field(:visibility, :event_visibility, description: "The event's visibility")
field(:visibility, :event_visibility, description: "The event's visibility")
field(:picture, :picture,
description: "The event's picture",
@@ -132,6 +132,7 @@ defmodule MobilizonWeb.Schema.EventType do
arg(:phone_address, :string)
arg(:organizer_actor_id, non_null(:id))
arg(:category, non_null(:string))
arg(:physical_address, :address_input)
resolve(&Event.create_event/3)
end