Skip to content

Commit

Permalink
Code format and lightboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
mcop1 committed Nov 28, 2024
1 parent ab2bd35 commit 2676394
Show file tree
Hide file tree
Showing 43 changed files with 135 additions and 20 deletions.
4 changes: 4 additions & 0 deletions doc/02_Basic_Principle.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ Pimcore Datahub allows defining multiple endpoints that allow data delivery and

1. Open the Datahub configuration panel:

<div class="image-as-lightbox"></div>

![Configuration Overview](./img/graphql/configuration3.png)


2. Choose an endpoint technology:

<div class="image-as-lightbox"></div>

![Add Configuration](./img/add_config.png)

3. Get the configuration done by defining the followings:
Expand Down
5 changes: 4 additions & 1 deletion doc/10_GraphQL/01_Configuration/01_General_Settings.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# General Settings

<div class="image-as-lightbox"></div>

![General Settings](../../img/graphql/general.png)

#### Some Aspects:
Expand All @@ -8,7 +10,8 @@
the [workspace settings](./03_Security_Settings.md).

SQL Condition is currently deprecated but still enabled by default. If you want to disable it, you can do so in the symfony configuration tree:
```

```yaml
pimcore_data_hub:
graphql:
allow_sqlObjectCondition: false
Expand Down
4 changes: 4 additions & 0 deletions doc/10_GraphQL/01_Configuration/02_Schema_Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Schema settings define which data entities (Data Object classes, Assets, Documents) should be exposed via the endpoint. For Assets and Documents, default schemas are provided, for Data Object classes the schema can be defined in the field configuration.

<div class="image-as-lightbox"></div>

![Add](../../img/graphql/schema_add.png)

## Query Schema
Expand All @@ -14,6 +16,8 @@ When adding a new entity with the `Add` button, you can access the `Available Fi

In addition, you can employ a set of operators.

<div class="image-as-lightbox"></div>

![Schema Settings](../../img/graphql/schema.png)

Please note that not all data types are supported yet!
Expand Down
3 changes: 3 additions & 0 deletions doc/10_GraphQL/01_Configuration/03_Security_Settings.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Security Settings

The security settings define how the endpoint is secured and which data is accessible.

<div class="image-as-lightbox"></div>

![security1.png](../../img/graphql/security1.png)

## Authentication
Expand Down
6 changes: 3 additions & 3 deletions doc/10_GraphQL/04_Query/08_Localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ You can change the default language for localized fields by passing the `default
for single and listing queries.

##### Sample Request
```
```graphql
{
getNewsListing(defaultLanguage: "de") {
...
Expand All @@ -18,7 +18,7 @@ for single and listing queries.
However, you can always provide an alternative language for a specific field.

##### Sample Request
```
```graphql
{
getUser(id: 50, defaultLanguage: "en") {
myAdvancedObjects {
Expand All @@ -39,7 +39,7 @@ However, you can always provide an alternative language for a specific field.
```

##### Response
```
```graphql
{
"data": {
"getUser": {
Expand Down
4 changes: 3 additions & 1 deletion doc/10_GraphQL/04_Query/10_Filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ to filter listing.


## Sample
Get all `Manufacturer` objects which have 'ca' in their name field.
Get all `Manufacturer` objects which have 'ca' in their name field.

<div class="image-as-lightbox"></div>

![Filtered Grid](../../img/graphql/filtering.png)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Get Element Properties

<div class="image-as-lightbox"></div>

![Sample Document Properties](../../../img/graphql/element_properties.png)

### Request
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Get Asset Metadata

<div class="image-as-lightbox"></div>

![Metadata](../../../img/graphql/asset_metadata.png)

Deeplink: [http://pimcore-demo-basic.pim.zone/admin/login/deeplink?asset_4_image](http://pimcore-demo-basic.pim.zone/admin/login/deeplink?asset_4_image)
Expand Down Expand Up @@ -82,6 +84,8 @@ Get the custom asset metadata for language `de`

## Get Asset Embedded Meta Info

<div class="image-as-lightbox"></div>

![Metadata](../../../img/graphql/asset_embeddedMetaInfo.png)

### Request
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Get Manufacturer Listing

<div class="image-as-lightbox"></div>

![Grid](../../../img/graphql/manufacturer_listing.png)

### Request
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Many-to-Many Object Relation

<div class="image-as-lightbox"></div>

![Data](../../../img/graphql/many_to_many_object_relation.png)

### Request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
Data Model:

<div class="image-as-lightbox"></div>

![Data](../../../img/graphql/advanced_many_to_many_object_relation.png)

Data:

<div class="image-as-lightbox"></div>

![Data](../../../img/graphql/advanced_many_to_many_object_relation2.png)

### Request
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Get Advanced Many-to-Many Relation Metadata

<div class="image-as-lightbox"></div>

![Metadata](../../../img/graphql/many2many.png)

>TODO: Align this with the new demo as soon as reasonable content is available.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@

If you want to run this sample on the [Official Demo Site](https://demo.pimcore.fun), please create the following configuration

<div class="image-as-lightbox"></div>

![Schema](../../../img/graphql/news_configuration.png)

### Sample Data

Deeplink: https://demo.pimcore.fun/admin/login/deeplink?object_767_object

<div class="image-as-lightbox"></div>

![Sample Data](../../../img/graphql/news_sample_data.png)

### Request
Expand Down Expand Up @@ -42,6 +46,8 @@ Deeplink: https://demo.pimcore.fun/admin/login/deeplink?object_767_object

and make sure that the `/News` folder is readable.

<div class="image-as-lightbox"></div>

![Workspace](../../../img/graphql/news_workspace.png)

### Response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

For example, to get `berlina` object's (id:261) parent, children and siblings

<div class="image-as-lightbox"></div>

![](../../../img/graphql/sample_parentChildrenSiblings.png)

### Request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Deeplink: [https://demo.pimcore.fun/admin/login/deeplink?object_277_object](http
Note that you have to adapt your schema definition as depicted below. The thumbnail
will be generated using the [Thumbnail operator](../../08_Operators/Query/AssetThumbnail.md).

<div class="image-as-lightbox"></div>

![Schema Definition](../../../img/graphql/manufacturer_thumbnail.png)

### Request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ Deeplink: [http://pimcore-demo-basic.pim.zone/admin/login/deeplink?object_373_ob

Operator Config:

<div class="image-as-lightbox"></div>

![Operator Config](../../../img/graphql/operator_translated1.png)

Website Translation Grid:

<div class="image-as-lightbox"></div>

![Data](../../../img/graphql/operator_translated2.png)

The idea in the following example is to use the website translation feature to convert
Expand Down
2 changes: 1 addition & 1 deletion doc/10_GraphQL/04_Query/15_Add_Custom_Query_Datatype.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ For adding a new query data type two steps are necessary:

To add a type definition, add a section similar to this one to your `services.yml` file.

```
```yaml
pimcore.datahub.graphql.dataobjectquerytypegenerator_datatype_mycustomdatatype:
class: Pimcore\Bundle\DataHubBundle\GraphQL\DataObjectQueryFieldConfigGenerator\MyCustomDatatype
tags:
Expand Down
4 changes: 2 additions & 2 deletions doc/10_GraphQL/04_Query/16_Add_Custom_Query_Operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ For adding a new query operator two steps are necessary:

Add a section similar to this one to your `services.yml` file.

```
```yaml
pimcore.datahub.graphql.querytypegenerator_operator_mycustomoperator:
class: Pimcore\Bundle\DataHubBundle\GraphQL\QueryOperatorConfigGenerator\MyCustomOperator
tags:
Expand All @@ -35,7 +35,7 @@ A sample can be found [here](https://github.com/pimcore/data-hub/blob/master/src
Finally, we have to define how the operator instances get created.
In most cases we use the `DefaultOperatorFactory` for that:

```
```yaml
pimcore.datahub.graphql.dataobjectqueryoperator.factory.mycustomoperator:
class: Pimcore\Bundle\DataHubBundle\GraphQL\Query\Operator\Factory\DefaultOperatorFactory
arguments:
Expand Down
1 change: 1 addition & 0 deletions doc/10_GraphQL/04_Query/20_Add_Custom_Query.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ if you need more information on Pimcore's event mechanism.
$event->setConfig($config);
});
```
<div class="image-as-lightbox"></div>

![iExplorer](../../img/graphql/add_query.png)

Expand Down
11 changes: 6 additions & 5 deletions doc/10_GraphQL/07_Mutation/20_DataObject_Mutations.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
Data object mutations are used to create, update and delete data objects, documents, assets and translations.
Keep in mind that for all kinds of mutations you need the `Write` permission and the mutation itself needs to be enabled in the configuration.
Please be aware, that not all operations are supported for all data types.


<div class="image-as-lightbox"></div>

![Mutation grid](../../img/graphql/mutation_grid.png)

Expand All @@ -21,7 +22,7 @@ See [operators section](../08_Operators/README.md) for more details.
## Create Object

Request:
```
```graphql
mutation {
createNews(parentId: 429, key: "news_created_by_gql", published: false) {
success
Expand Down Expand Up @@ -59,7 +60,7 @@ Response:
Updates german title and short text and returns the modification date.

Request:
```
```graphql
mutation {
updateNews(id: 1196, defaultLanguage: "de", input: {
title: "german TITLE",
Expand Down Expand Up @@ -93,7 +94,7 @@ Response:
## Delete Object

Request:
```
```graphql
mutation {
deleteNews(id: 1196) {
success
Expand All @@ -103,7 +104,7 @@ mutation {
```

Response:
```
```graphql
{
"data": {
"deleteNews": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@ mutation {
}
}
```
<div class="image-as-lightbox"></div>

![Grid](../../../img/graphql/document_create_mutation.png)
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ mutation {
}
```

<div class="image-as-lightbox"></div>

![Grid](../../../img/graphql/document_updateemail_mutation.png)
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ mutation {
}
}
```

<div class="image-as-lightbox"></div>

![Grid](../../../img/graphql/document_create_link.png)
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ mutation {
}
}
}
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ For adding a new mutation data type two steps are necessary:

Add a section similar to this one to your `services.yml` file.

```
```yaml
pimcore.datahub.graphql.dataobjectmutationtypegenerator_datatype_mycustomdatatype:
class: Pimcore\Bundle\DataHubBundle\GraphQL\DataObjectMutationFieldConfigGenerator\MyCustomDatatype
tags:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ For adding a new mutation operator two steps are necessary:
### Type Definition
Add a section similar to this one to your `services.yml` file.

```
```yaml
pimcore.datahub.graphql.dataobjectmutationtypegenerator_operator_mycustommutationoperator:
class: Pimcore\Bundle\DataHubBundle\GraphQL\DataObjectMutationOperatorConfigGenerator\MyCustomMutationOperator
tags:
Expand Down
1 change: 1 addition & 0 deletions doc/10_GraphQL/07_Mutation/27_Add_Custom_Mutations.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ if you need more information on Pimcore's event mechanism.
$event->setConfig($config);
});
```
<div class="image-as-lightbox"></div>

![iExplorer](../../img/graphql/add_mutation.png)

Expand Down
4 changes: 4 additions & 0 deletions doc/10_GraphQL/08_Operators/Mutation/IfEmpty.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ Only sets the value if current one is empty. Add the operator to the list and dr

## Configuration

<div class="image-as-lightbox"></div>

![ifempty_config.png](../../../img/graphql/ifempty_config.png)

- **Label**: Field name to be used in the query.

## Example

<div class="image-as-lightbox"></div>

![ifempty_example.png](../../../img/graphql/ifempty_example.png)

Request:
Expand Down
4 changes: 4 additions & 0 deletions doc/10_GraphQL/08_Operators/Mutation/LocalCollector.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ Allows editing all languages for a single field.

## Configuration

<div class="image-as-lightbox"></div>

![locale_collector_config.png](../../../img/graphql/locale_collector_config.png)

- **Label**: Name for the field to be used in the mutation.

## Example

<div class="image-as-lightbox"></div>

![locale_collector_example.png](../../../img/graphql/locale_collector_example.png)

Request:
Expand Down
Loading

0 comments on commit 2676394

Please sign in to comment.