Work around Addresses to bring them properly through GraphQL

Got caught with https://github.com/absinthe-graphql/absinthe/issues/601
at some point, that's why fields are renamed

Fix tests

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-03-22 15:51:23 +01:00
parent 53458b16a2
commit 0c8d2f7e00
25 changed files with 200 additions and 145 deletions

View File

@@ -3,7 +3,7 @@ defmodule MobilizonWeb.Schema.EventType do
Schema representation for Event
"""
use Absinthe.Schema.Notation
alias Mobilizon.Actors
alias Mobilizon.{Actors, Addresses}
import Absinthe.Resolution.Helpers, only: [dataloader: 1]
import_types(MobilizonWeb.Schema.AddressType)
import_types(MobilizonWeb.Schema.Events.ParticipantType)
@@ -27,7 +27,12 @@ defmodule MobilizonWeb.Schema.EventType do
# TODO replace me with banner
field(:large_image, :string, description: "A large picture for the event")
field(:publish_at, :datetime, description: "When the event was published")
field(:physical_address, :physical_address, description: "The type of the event's address")
field(:physical_address, :address,
resolve: dataloader(Addresses),
description: "The type of the event's address"
)
field(:online_address, :online_address, description: "Online address of the event")
field(:phone_address, :phone_address, description: "Phone address for the event")