Skip to content

Commit

Permalink
Merge pull request #51 from ibexa/temp_2.3_to_4.4
Browse files Browse the repository at this point in the history
Merge branch '2.3' of ezsystems/ezplatform-graphql into 4.4
  • Loading branch information
webhdx authored Mar 24, 2023
2 parents 1901315 + 7109e63 commit f02ad90
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/bundle/Resources/config/default_settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ parameters:
ibexa.graphql.schema.content.mapping.field_definition_type:
ezauthor:
value_type: "[AuthorFieldValue]"
value_resolver: 'field.authors'
value_resolver: 'field !== null ? field.authors : null'
input_type: '[AuthorInput]'
ezbinaryfile:
definition_type: BinaryFieldDefinition
Expand All @@ -13,19 +13,19 @@ parameters:
ezboolean:
definition_type: CheckboxFieldDefinition
value_type: Boolean
value_resolver: 'field.bool'
value_resolver: 'field !== null ? field.bool : null'
input_type: Boolean
ezcountry:
definition_type: CountryFieldDefinition
value_type: String
input_type: '[String]'
ezdate:
value_type: DateTime
value_resolver: 'field.date'
value_resolver: 'field !== null ? field.date : null'
input_type: DateFieldInput
ezdatetime:
value_type: DateTime
value_resolver: 'field.value'
value_resolver: 'field !== null ? field.value : null'
input_type: DateFieldInput
ezemail:
value_type: String
Expand All @@ -35,7 +35,7 @@ parameters:
ezfloat:
definition_type: FloatFieldDefinition
value_type: Float
value_resolver: 'field.value'
value_resolver: 'field !== null ? field.value : null'
input_type: Float
ezgmaplocation:
value_type: MapLocationFieldValue
Expand All @@ -50,11 +50,11 @@ parameters:
ezinteger:
definition_type: IntegerFieldDefinition
value_type: Int
value_resolver: 'field.value'
value_resolver: 'field !== null ? field.value : null'
input_type: Int
ezkeyword:
value_type: '[String]'
value_resolver: 'field.values'
value_resolver: 'field !== null ? field.values : null'
input_type: '[String]'
ezmedia:
definition_type: MediaFieldDefinition
Expand Down
6 changes: 5 additions & 1 deletion src/lib/Resolver/DomainContentResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,12 @@ public function resolveDomainFieldValue(Content $content, $fieldDefinitionIdenti
return Field::fromField($content->getField($fieldDefinitionIdentifier, $args['language'] ?? null));
}

public function resolveDomainRelationFieldValue(Field $field, $multiple = false)
public function resolveDomainRelationFieldValue(?Field $field, $multiple = false)
{
if ($field === null) {
return null;
}

$destinationContentIds = $this->getContentIds($field);

if (empty($destinationContentIds) || array_key_exists(0, $destinationContentIds) && null === $destinationContentIds[0]) {
Expand Down
6 changes: 5 additions & 1 deletion src/lib/Resolver/ImageAssetFieldResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ public function __construct(iterable $strategies)
}
}

public function resolveDomainImageAssetFieldValue(Field $field): ?Field
public function resolveDomainImageAssetFieldValue(?Field $field): ?Field
{
if ($field === null) {
return null;
}

$destinationContentId = $field->value->destinationContentId;

if ($destinationContentId === null) {
Expand Down
6 changes: 5 additions & 1 deletion src/lib/Resolver/SelectionFieldResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ public function __construct(
$this->contentTypeLoader = $contentTypeLoader;
}

public function resolveSelectionFieldValue(Field $field, Content $content)
public function resolveSelectionFieldValue(?Field $field, Content $content)
{
if ($field === null) {
return null;
}

$fieldDefinition = $this
->contentTypeLoader->load($content->contentInfo->contentTypeId)
->getFieldDefinition($field->fieldDefIdentifier);
Expand Down

0 comments on commit f02ad90

Please sign in to comment.