Skip to content

Commit b230e80

Browse files
committed
Fix built in fields selection in module configuration form.
1 parent 539f24e commit b230e80

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

ProcessGraphQLConfig.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ public function getInputFields()
238238
$f->label = 'Legal Page Fields';
239239
$f->description = 'Choose which built in `Page` fields you wish to be available via GraphQL api.';
240240
$f->notes = 'Be careful with fields like `parents` & `children` that will allow user to construct deeply nested queries that might be very expensive for your server to fulfill.';
241-
foreach (PageType::type()->getFields() as $field) {
242-
$f->addOption($field->name);
241+
foreach (PageType::getBuiltInFields() as $field) {
242+
$f->addOption($field['name']);
243243
}
244244
$inputfields->add($f);
245245

@@ -250,8 +250,8 @@ public function getInputFields()
250250
$f->label = 'Legal PageFile Fields';
251251
$f->description = 'Choose which built in `PageFile` fields you wish to be available via GraphQL api.';
252252
$f->notes = 'These fields are also inherited by `PageImage`.';
253-
foreach (FileType::type()->getFields() as $field) {
254-
$f->addOption($field->name);
253+
foreach (FileType::getBuiltInFields() as $field) {
254+
$f->addOption($field['name']);
255255
}
256256
$inputfields->add($f);
257257

@@ -261,11 +261,8 @@ public function getInputFields()
261261
$f->attr('name', 'legalPageImageFields');
262262
$f->label = 'Legal PageImage Fields';
263263
$f->description = 'Choose which built in `PageImage` fields you wish to be available via GraphQL api.';
264-
foreach (ImageType::type()->getFields() as $field) {
265-
if(in_array($field, FileType::type()->getFields())) {
266-
continue;
267-
}
268-
$f->addOption($field->name);
264+
foreach (ImageType::getBuiltInFields() as $field) {
265+
$f->addOption($field['name']);
269266
}
270267
$inputfields->add($f);
271268

0 commit comments

Comments
 (0)