From 0541fb0ada16e6bf1f1e4b9fd4f24f9c0e47564a Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 1 Dec 2020 17:30:41 +0100 Subject: [PATCH] Allow event's attributedTo to use the Dataloader Signed-off-by: Thomas Citharel --- lib/graphql/schema/event.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/graphql/schema/event.ex b/lib/graphql/schema/event.ex index a6d5865bc..e3cd9f31a 100644 --- a/lib/graphql/schema/event.ex +++ b/lib/graphql/schema/event.ex @@ -56,7 +56,10 @@ defmodule Mobilizon.GraphQL.Schema.EventType do description: "The event's organizer (as a person)" ) - field(:attributed_to, :actor, description: "Who the event is attributed to (often a group)") + field(:attributed_to, :actor, + resolve: dataloader(Actors), + description: "Who the event is attributed to (often a group)" + ) field(:tags, list_of(:tag), resolve: &Tag.list_tags_for_event/3,