Skip to content

Commit d739e56

Browse files
committed
Merge remote-tracking branch 'origin/1.9' into 1.x
2 parents df1eada + d5619f3 commit d739e56

File tree

10 files changed

+22
-44
lines changed

10 files changed

+22
-44
lines changed

doc/10_GraphQL/04_Query/15_Add_Custom_Query_Datatype.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ To add a type definition, add a section similar to this one to your `services.ym
1515
```
1616
1717
For reference, have a look at a look at the
18-
[`Link datatype`](https://github.com/pimcore/data-hub/blob/master/src/GraphQL/DataObjectQueryFieldConfigGenerator/Link.php).
18+
[`Link datatype`](https://github.com/pimcore/data-hub/blob/2.x/src/GraphQL/DataObjectQueryFieldConfigGenerator/Link.php).
1919
It also shows how specific attributes are resolved.
2020

2121
If you don't provide a resolver function then the getter method is called instead.

doc/10_GraphQL/04_Query/16_Add_Custom_Query_Operator.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ Add a section similar to this one to your `services.yml` file.
1616
```
1717
1818
For reference, have a look at a look at the
19-
[`Trimmer operator`](https://github.com/pimcore/data-hub/blob/master/src/GraphQL/Query/Operator/Trimmer.php).
19+
[`Trimmer operator`](https://github.com/pimcore/data-hub/blob/2.x/src/GraphQL/Query/Operator/Trimmer.php).
2020

2121
### Operator Implementation
2222

2323
You have to provide both JavaScript code dealing with the UI configuration aspects specific to your operator
2424
and the server-side PHP implementation doing the actual calculations.
2525

26-
A JS sample can be found [here](https://github.com/pimcore/data-hub/blob/master/src/Resources/public/js/queryoperator/Trimmer.js).
26+
A JS sample can be found [here](https://github.com/pimcore/data-hub/blob/2.x/src/Resources/public/js/queryoperator/Trimmer.js).
2727

2828
:::info
2929

@@ -35,7 +35,7 @@ Make sure, that your extension gets loaded. See [Pimcore Bundles](https://pimcor
3535
docs page for further details.
3636

3737
Next thing is to provide the server-side implementation.
38-
A sample can be found [here](https://github.com/pimcore/data-hub/blob/master/src/GraphQL/Query/Operator/Trimmer.php).
38+
A sample can be found [here](https://github.com/pimcore/data-hub/blob/2.x/src/GraphQL/Query/Operator/Trimmer.php).
3939

4040
Finally, we have to define how the operator instances get created.
4141
In most cases we use the `DefaultOperatorFactory` for that:

doc/10_GraphQL/07_Mutation/25_Add_Custom_Mutation_Datatype.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ Add a section similar to this one to your `services.yml` file.
1414
```
1515
1616
For reference, have a look at a look at the
17-
[`Geopoint datatype`](https://github.com/pimcore/data-hub/blob/master/src/GraphQL/DataObjectMutationFieldConfigGenerator/Geopoint.php).
17+
[`Geopoint datatype`](https://github.com/pimcore/data-hub/blob/2.x/src/GraphQL/DataObjectMutationFieldConfigGenerator/Geopoint.php).
1818

1919
You return a valid GraphQL input type (which is an `InputObjectType`) here and a `Processor` which processes the actual
2020
input data.
2121

2222
For a rather simple example have a look at the
23-
[`Date`](https://github.com/pimcore/data-hub/blob/master/src/GraphQL/DataObjectMutationFieldConfigGenerator/Date.php)
23+
[`Date`](https://github.com/pimcore/data-hub/blob/2.x/src/GraphQL/DataObjectMutationFieldConfigGenerator/Date.php)
2424
implementation (which both accepts integer and string input values).
2525

doc/10_GraphQL/07_Mutation/26_Add_Custom_Mutation_Operator.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Add a section similar to this one to your `services.yml` file.
1515
```
1616
1717
For reference have a look at:
18-
[`IfEmpty Operator`](https://github.com/pimcore/data-hub/blob/master/src/GraphQL/DataObjectMutationOperatorConfigGenerator/IfEmpty.php).
18+
[`IfEmpty Operator`](https://github.com/pimcore/data-hub/blob/2.x/src/GraphQL/DataObjectMutationOperatorConfigGenerator/IfEmpty.php).
1919

2020
This will again define a processor (see the next subsection) and try to automatically determine the input type
2121
depending on its child element.
@@ -27,7 +27,7 @@ You have to provide both JavaScript code dealing with the UI configuration aspec
2727
and the server-side PHP implementation processing the input (the input processor according to your input schema).
2828

2929
A JS sample can be found
30-
[here](https://github.com/pimcore/data-hub/blob/master/src/Resources/public/js/mutationoperator/IfEmpty.js).
30+
[here](https://github.com/pimcore/data-hub/blob/2.x/src/Resources/public/js/mutationoperator/IfEmpty.js).
3131

3232
:::info
3333

@@ -40,7 +40,7 @@ docs page for further details.
4040

4141
Next thing is to provide the input processor on the server side.
4242
A sample can be found
43-
[here](https://github.com/pimcore/data-hub/blob/master/src/GraphQL/DataObjectInputProcessor/IfEmptyOperator.php).
43+
[here](https://github.com/pimcore/data-hub/blob/2.x/src/GraphQL/DataObjectInputProcessor/IfEmptyOperator.php).
4444
It will get the child value and only overwrite the current value if it is empty.
4545

4646

doc/10_GraphQL/10_Events.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Events
22

33
Datahub GraphQL events are based on the Symfony event dispatcher, and are triggered during execution of Query and Mutation requests.
4-
[Read more](https://github.com/pimcore/pimcore/blob/master/doc/Development_Documentation/20_Extending_Pimcore/11_Event_API_and_Event_Manager.md) about events on Pimcore documentation.
4+
[Read more](https://docs.pimcore.com/platform/Pimcore/Extending_Pimcore/Event_API_and_Event_Manager) about events on Pimcore documentation.
55

66
All Datahub events are defined as a constant on component classes:
7-
- [Query](https://github.com/pimcore/data-hub/blob/master/src/Event/GraphQL/QueryEvents.php)
8-
- [Mutation](https://github.com/pimcore/data-hub/blob/master/src/Event/GraphQL/MutationEvents.php)
9-
- [Executor](https://github.com/pimcore/data-hub/blob/master/src/Event/GraphQL/ExecutorEvents.php)
10-
- [Listing](https://github.com/pimcore/data-hub/blob/master/src/Event/GraphQL/ListingEvents.php)
11-
- [Ouput cache](https://github.com/pimcore/data-hub/blob/master/src/Event/GraphQL/OutputCacheEvents.php)
7+
- [Query](https://github.com/pimcore/data-hub/blob/2.x/src/Event/GraphQL/QueryEvents.php)
8+
- [Mutation](https://github.com/pimcore/data-hub/blob/2.x/src/Event/GraphQL/MutationEvents.php)
9+
- [Executor](https://github.com/pimcore/data-hub/blob/2.x/src/Event/GraphQL/ExecutorEvents.php)
10+
- [Listing](https://github.com/pimcore/data-hub/blob/2.x/src/Event/GraphQL/ListingEvents.php)
11+
- [Ouput cache](https://github.com/pimcore/data-hub/blob/2.x/src/Event/GraphQL/OutputCacheEvents.php)
1212

1313
## Event Subscriber Examples
1414

@@ -180,8 +180,7 @@ class GraphQlSubscriber implements EventSubscriberInterface
180180

181181
#### Example 4: Add custom query conditions to object listing
182182

183-
- For global SQL conditions also [General Settings](https://github.com/pimcore/data-hub/blob/master/doc/graphl/General.md#general-settings)
184-
- For simple filter conditions also see [Filtering](https://github.com/pimcore/data-hub/blob/master/doc/graphl/Filtering.md#request)
183+
- For simple filter conditions also see [Filtering](./04_Query/10_Filtering.md)
185184

186185
```php
187186
<?php

phpunit.xml.dist

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/Controller/WebserviceController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public function webonyxAction(
168168
$query = $input['query'] ?? '';
169169

170170
try {
171-
$rootValue = [];
171+
$rootValue = null;
172172

173173
$validators = null;
174174

src/GraphQL/DataObjectType/MultihrefMetadataType.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,15 @@ public function build(&$config)
5959
{
6060
$fieldDefinition = $this->fieldDefinition;
6161
$class = $this->class;
62+
$metadataKeyValuePairType = ElementMetadataKeyValuePairType::getInstance();
6263
$resolver = new MultihrefMetadata($fieldDefinition, $class, $this->getGraphQlService()->getObjectFieldHelper());
6364
$fields = ['element' =>
6465
[
6566
'type' => new HrefType($this->getGraphQlService(), $this->fieldDefinition, $this->class),
6667
'resolve' => [$resolver, 'resolveElement'],
6768
],
6869
'metadata' => [
69-
'type' => Type::listOf(new ElementMetadataKeyValuePairType()),
70+
'type' => Type::listOf($metadataKeyValuePairType),
7071
'resolve' => [$resolver, 'resolveMetadata'],
7172
]];
7273

src/GraphQL/DataObjectType/ObjectMetadataType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function build(&$config)
6767

6868
$className = $fieldDefinition->getAllowedClassId();
6969
$elementTypeDefinition = ClassTypeDefinitions::get($className);
70-
70+
$metadataKeyValuePairType = ElementMetadataKeyValuePairType::getInstance();
7171
$resolver = new ObjectMetadata($fieldDefinition, $class, $fieldHelper);
7272

7373
$fields = ['element' =>
@@ -76,7 +76,7 @@ public function build(&$config)
7676
'resolve' => [$resolver, 'resolveElement'],
7777
],
7878
'metadata' => [
79-
'type' => Type::listOf(new ElementMetadataKeyValuePairType()),
79+
'type' => Type::listOf($metadataKeyValuePairType),
8080
'resolve' => [$resolver, 'resolveMetadata'],
8181

8282
]];

src/GraphQL/Mutation/MutationType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ public function buildDataObjectMutations(&$config = [], $context = [])
628628
$newInstance->setType($args['type']);
629629
}
630630

631-
$resolver = $me->getUpdateObjectResolver($processors, $localeService, $newInstance, $me->omitPermissionCheck);
631+
$resolver = $me->getUpdateObjectResolver($processors, $localeService, $newInstance, true);
632632

633633
$returnValue = call_user_func_array($resolver, [$value, $args, $context, $info]);
634634
if (isset($returnValue['success']) === true &&

0 commit comments

Comments
 (0)