Skip to content

Commit

Permalink
IBX-8536: Removed deprecations in graphql
Browse files Browse the repository at this point in the history
  • Loading branch information
glye committed Jul 22, 2024
1 parent ba5e369 commit 4ea1f95
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 211 deletions.
13 changes: 5 additions & 8 deletions doc/howto/custom_field_type.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,14 @@ class RelationFieldDefinitionMapper extends DecoratingFieldDefinitionMapper impl
}
```

#### Field Definition Input Mappers
As of v1.0.4, an extra interface is available for mutation input type handling, `FieldDefinitionInputMapper`.
It is used if the input for this field depends on the field definition. For instance, `ezmatrix`
generates its own input types depending on the configured columns. It defines an extra method, `mapToFieldValueInputType`,
that returns a GraphQL type for a Field Definition.
#### Mutation input type handling
If the input for a field depends on the field definition, like `ezmatrix`
which generates its own input types depending on the configured columns, use `mapToFieldValueInputType`
which returns a GraphQL type for a Field Definition.

Example:
```
class MyFieldDefinitionMapper extends DecoratingFieldDefinitionMapper implements FieldDefinitionMapper, FieldDefinitionInputMapper
class MyFieldDefinitionMapper extends DecoratingFieldDefinitionMapper implements FieldDefinitionMapper
{
public function mapToFieldValueInputType(ContentType $contentType, FieldDefinition $fieldDefinition): ?string
{
Expand All @@ -181,8 +180,6 @@ class MyFieldDefinitionMapper extends DecoratingFieldDefinitionMapper implements
}
```

In 2.0, `FieldDefinitionInputMapper` and `FieldDefinitionMapper` will be merged, and the service tag will be deprecated.

## Resolver expressions
Two variables are available in the resolver's expression:

Expand Down
8 changes: 0 additions & 8 deletions src/lib/Resolver/DomainContentResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,6 @@ public function resolveMainUrlAlias(Content $content)
return isset($aliases[0]->path) ? $aliases[0]->path : null;
}

/**
* @deprecated since v3.0, use ItemResolver::resolveItemFieldValue() instead.
*/
public function resolveDomainFieldValue(Content $content, $fieldDefinitionIdentifier, $args = null)
{
return Field::fromField($content->getField($fieldDefinitionIdentifier, $args['language'] ?? null));
}

public function resolveDomainRelationFieldValue(?Field $field, $multiple = false)
{
if ($field === null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinition;
use Ibexa\Contracts\GraphQL\Schema\Domain\Content\Mapper\FieldDefinition\FieldDefinitionMapper;

class ConfigurableFieldDefinitionMapper implements FieldDefinitionMapper, FieldDefinitionInputMapper, FieldDefinitionArgsBuilderMapper
class ConfigurableFieldDefinitionMapper implements FieldDefinitionMapper
{
/**
* @var array
Expand Down

This file was deleted.

This file was deleted.

115 changes: 0 additions & 115 deletions src/lib/Schema/Domain/Content/NameHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,164 +38,56 @@ public function __construct(
$this->fieldNameOverrides = $fieldNameOverrides;
}

/**
* @deprecated since v3.0, will be removed in v4.0. Use itemConnectionField() instead.
*/
public function domainContentCollectionField(ContentType $contentType)
{
@trigger_error('Deprecated since v3.0, will be removed in v4.0. Use itemConnectionFieldName() instead.', E_USER_DEPRECATED);

return $this->itemConnectionField($contentType);
}

public function itemConnectionField(ContentType $contentType)
{
return $this->pluralize(lcfirst($this->toCamelCase($contentType->identifier)));
}

/**
* @deprecated since v3.0, will be removed in v4.0. Use itemName() instead.
*/
public function domainContentName(ContentType $contentType)
{
@trigger_error('Deprecated since v3.0, will be removed in v4.0. Use itemName() instead.', E_USER_DEPRECATED);

return $this->itemName($contentType);
}

public function itemName(ContentType $contentType)
{
return ucfirst($this->toCamelCase($contentType->identifier)) . 'Item';
}

/**
* @deprecated since v3.0, will be removed in v4.0. Use itemConnectionName() instead.
*/
public function domainContentConnection($contentType)
{
@trigger_error('Deprecated since v3.0, will be removed in v4.0. Use itemConnectionName() instead.', E_USER_DEPRECATED);

return $this->itemConnectionName($contentType);
}

public function itemConnectionName($contentType)
{
return ucfirst($this->toCamelCase($contentType->identifier)) . 'ItemConnection';
}

/**
* @deprecated since v3.0, will be removed in v4.0. Use itemCreateInputName() instead.
*/
public function domainContentCreateInputName(ContentType $contentType)
{
@trigger_error('Deprecated since v3.0, will be removed in v4.0. Use itemCreateInputName() instead.', E_USER_DEPRECATED);

return $this->itemCreateInputName($contentType);
}

public function itemCreateInputName(ContentType $contentType)
{
return ucfirst($this->toCamelCase($contentType->identifier)) . 'ItemCreateInput';
}

/**
* @deprecated since v3.0, will be removed in v4.0. Use itemUpdateInputName() instead.
*/
public function domainContentUpdateInputName(ContentType $contentType)
{
@trigger_error('Deprecated since v3.0, will be removed in v4.0. Use itemUpdateInputName() instead.', E_USER_DEPRECATED);

return $this->itemUpdateInputName($contentType);
}

public function itemUpdateInputName(ContentType $contentType)
{
return ucfirst($this->toCamelCase($contentType->identifier)) . 'ItemUpdateInput';
}

/**
* @deprecated since v3.0, will be removed in v4.0. Use itemUpdateInputName() instead.
*/
public function domainContentTypeName(ContentType $contentType)
{
@trigger_error('Deprecated since v3.0, will be removed in v4.0. Use itemTypeName() instead.', E_USER_DEPRECATED);

return $this->itemTypeName($contentType);
}

public function itemTypeName(ContentType $contentType)
{
return ucfirst($this->toCamelCase($contentType->identifier)) . 'ItemType';
}

/**
* @deprecated since v3.0, will be removed in v4.0. Use itemField() instead.
*/
public function domainContentField(ContentType $contentType)
{
@trigger_error('Deprecated since v3.0, will be removed in v4.0. Use itemField() instead.', E_USER_DEPRECATED);

return $this->itemField($contentType);
}

public function itemField(ContentType $contentType)
{
return lcfirst($this->toCamelCase($contentType->identifier));
}

/**
* @deprecated since v3.0, will be removed in v4.0. Use itemMutationCreateItemField() instead.
*/
public function domainMutationCreateContentField(ContentType $contentType)
{
return $this->itemMutationCreateItemField($contentType);
}

public function itemMutationCreateItemField(ContentType $contentType)
{
return 'create' . ucfirst($this->itemField($contentType));
}

/**
* @deprecated since v3.0, will be removed in v4.0. Use itemMutationUpdateItemField() instead.
*/
public function domainMutationUpdateContentField(ContentType $contentType)
{
@trigger_error('Deprecated since v3.0, will be removed in v4.0. Use itemMutationUpdateItemField() instead.', E_USER_DEPRECATED);

return $this->itemMutationUpdateItemField($contentType);
}

public function itemMutationUpdateItemField($contentType)
{
return 'update' . ucfirst($this->itemField($contentType));
}

/**
* @deprecated since v3.0, will be removed in v4.0. Use itemGroupName() instead.
*/
public function domainGroupName(ContentTypeGroup $contentTypeGroup)
{
@trigger_error('Deprecated since v3.0, will be removed in v4.0. Use itemGroupName() instead.', E_USER_DEPRECATED);

return $this->itemGroupName($contentTypeGroup);
}

public function itemGroupName(ContentTypeGroup $contentTypeGroup)
{
return 'ItemGroup' . ucfirst($this->toCamelCase($this->sanitizeContentTypeGroupIdentifier($contentTypeGroup)));
}

/**
* @deprecated since v3.0, will be removed in v4.0. Use itemGroupTypesName() instead.
*/
public function domainGroupTypesName(ContentTypeGroup $contentTypeGroup)
{
@trigger_error('Deprecated since v3.0, will be removed in v4.0. Use itemGroupTypesName() instead.', E_USER_DEPRECATED);

return $this->itemGroupTypesName($contentTypeGroup);
}

public function itemGroupTypesName(ContentTypeGroup $contentTypeGroup)
{
return sprintf(
Expand All @@ -206,13 +98,6 @@ public function itemGroupTypesName(ContentTypeGroup $contentTypeGroup)
);
}

public function domainGroupField(ContentTypeGroup $contentTypeGroup)
{
@trigger_error('Deprecated since v3.0, will be removed in v4.0. Use itemGroupField() instead.', E_USER_DEPRECATED);

return $this->itemGroupField($contentTypeGroup);
}

public function itemGroupField(ContentTypeGroup $contentTypeGroup)
{
return lcfirst($this->toCamelCase($this->sanitizeContentTypeGroupIdentifier($contentTypeGroup)));
Expand Down
44 changes: 0 additions & 44 deletions src/lib/Schema/ImagesVariationsBuilder.php

This file was deleted.

0 comments on commit 4ea1f95

Please sign in to comment.