GraphQL: Entries relatedTo CalendarEvent #419
Aku-benj
started this conversation in
Feature Requests
Replies: 1 comment
-
|
For reference, since 5.9 it is now possible to register custom argument directly in I will try to update the code above shortly. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What is your idea?
Hi,
I am working on a project where Events are related to Entries through field selector
I have a listing page that fetch Calendar Events with some filters. Those filters are the ones related to my events only.
It doesnt seem to be possible via Graphql with the current flow to filter entries on related Events via
relatedToEntriesargument. Calendar Event are not really an entry section so we can't benefit of therelatedToEntrieson other entry sections.So I wanted to share with others my current way to work around that.
Maybe it could directly be implemented in the plugin with a bit of documentation.
What I want :
What I am trying to do (get the list of "lieux"|entries related to events of my calendar) :
{ lieuxStructureEntries( site: "en" relatedToEntries: { section: "calendarEvent" <-- do not exist site: "en", loadOccurrences: false, calendarId: 4 } ) { ... on lieuStructure_Entry { title } } }What I ended up doing :
{ lieuxStructureEntries( site: "en" relatedToCalendarEvents: { <-- see below for code site: "en", loadOccurrences: false, calendarId: 4 } ) { ... on lieuStructure_Entry { title } } }How ? #
Solspace\Calendar\Bundles\GraphQL\Arguments\EventArguments:RelatedCalendarEventsargument Handler usingSolspace\Calendar\Elements\Event:Final result :

Calendar Version
5.x
Craft Version
5.x
Beta Was this translation helpful? Give feedback.
All reactions