Skip to content

Commit

Permalink
Index section queries using the actual query name
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Jan 31, 2025
1 parent c3d0116 commit 493dea2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gql/queries/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ protected static function getSectionLevelFields(): array

// For each `sectionHandle` => [EntryTypeModel]
foreach ($entryTypeMap as $sectionHandle => $entryTypes) {
$name = $sectionHandle . 'Entries';
$typeName = $sectionHandle . 'SectionEntriesQuery';

// Unless we already have the type
Expand All @@ -100,7 +101,7 @@ protected static function getSectionLevelFields(): array

// Create the section query field
$sectionQueryType = [
'name' => $sectionHandle . 'Entries',
'name' => $name,
'args' => $arguments,
'description' => 'Entries within the ' . $sectionHandle . ' section.',
'type' => Type::listOf(GqlHelper::getUnionType($sectionHandle . 'SectionEntryUnion', $entryTypesInSection)),
Expand All @@ -112,7 +113,7 @@ protected static function getSectionLevelFields(): array
];
}

$gqlTypes[$sectionHandle] = $sectionQueryType;
$gqlTypes[$name] = $sectionQueryType;
}

return $gqlTypes;
Expand Down

0 comments on commit 493dea2

Please sign in to comment.