diff --git a/src/gql/mutations/Entry.php b/src/gql/mutations/Entry.php index 62f314c5764..19a621cdbe3 100644 --- a/src/gql/mutations/Entry.php +++ b/src/gql/mutations/Entry.php @@ -45,7 +45,7 @@ public static function getMutations(): array $canSave = Gql::canSchema($scope, 'save'); if ($canCreate || $canSave) { - // Create a mutation for each editable section that includes the entry type + // Create a mutation for each entry type foreach ($section->getEntryTypes() as $entryType) { foreach (static::createSaveMutations($section, $entryType, $canSave) as $mutation) { $mutationList[$mutation['name']] = $mutation; diff --git a/src/gql/queries/Entry.php b/src/gql/queries/Entry.php index 8db7a712850..610c6aa6996 100644 --- a/src/gql/queries/Entry.php +++ b/src/gql/queries/Entry.php @@ -107,7 +107,7 @@ protected static function getSectionLevelFields(): array $sectionQueryType = [ 'name' => "{$section->handle}Entries", 'args' => $arguments, - 'description' => "Entries within the $section->name section.", + 'description' => sprintf('Entries within the ā€œ%sā€ section.', $section->name), 'type' => Type::listOf(GqlHelper::getUnionType("{$section->handle}SectionEntryUnion", $entryTypesInSection)), // Enforce the section argument and set the source to `null`, to enforce a new element query. 'resolve' => fn($source, array $arguments, $context, ResolveInfo $resolveInfo) => diff --git a/src/gql/resolvers/elements/Entry.php b/src/gql/resolvers/elements/Entry.php index 2fe6f5ba698..61b30788a0e 100644 --- a/src/gql/resolvers/elements/Entry.php +++ b/src/gql/resolvers/elements/Entry.php @@ -31,8 +31,6 @@ public static function prepareQuery(mixed $source, array $arguments, ?string $fi // If this is the beginning of a resolver chain, start fresh if ($source === null) { $query = EntryElement::find(); - - $pairs = GqlHelper::extractAllowedEntitiesFromSchema('read'); if (!isset($pairs['sections'])) { diff --git a/src/helpers/Gql.php b/src/helpers/Gql.php index c54c48d8c9e..aecd217404c 100644 --- a/src/helpers/Gql.php +++ b/src/helpers/Gql.php @@ -576,13 +576,9 @@ public static function getSchemaContainedEntryTypes(?GqlSchema $schema = null): { $entryTypes = []; - foreach (Craft::$app->getEntries()->getAllSections() as $section) { - if (self::isSchemaAwareOf("sections.$section->uid", $schema)) { - foreach ($section->getEntryTypes() as $entryType) { - if (!isset($entryTypes[$entryType->uid])) { - $entryTypes[$entryType->uid] = $entryType; - } - } + foreach (static::getSchemaContainedSections($schema) as $section) { + foreach ($section->getEntryTypes() as $entryType) { + $entryTypes[$entryType->uid] = $entryType; } } @@ -599,7 +595,7 @@ public static function getSchemaContainedSections(?GqlSchema $schema = null): ar { return array_filter( Craft::$app->getEntries()->getAllSections(), - fn(Section $section) => self::isSchemaAwareOf("sections.$section->uid", $schema), + fn(Section $section) => static::isSchemaAwareOf("sections.$section->uid", $schema), ); }