diff --git a/src/config/sync/field.field.paragraph.entite_concernement.field_menace_maintien_degres.yml b/src/config/sync/field.field.paragraph.entite_concernement.field_menace_maintien_degres.yml index 6f90fa9..88149eb 100644 --- a/src/config/sync/field.field.paragraph.entite_concernement.field_menace_maintien_degres.yml +++ b/src/config/sync/field.field.paragraph.entite_concernement.field_menace_maintien_degres.yml @@ -10,7 +10,7 @@ field_name: field_menace_maintien_degres entity_type: paragraph bundle: entite_concernement label: 'Menace - Maintien' -description: '' +description: 'between -90 to 90' required: false translatable: false default_value: diff --git a/src/config/sync/field.field.paragraph.entite_concernement.field_prise.yml b/src/config/sync/field.field.paragraph.entite_concernement.field_prise.yml index c2e94b1..29c5e50 100644 --- a/src/config/sync/field.field.paragraph.entite_concernement.field_prise.yml +++ b/src/config/sync/field.field.paragraph.entite_concernement.field_prise.yml @@ -10,7 +10,7 @@ field_name: field_prise entity_type: paragraph bundle: entite_concernement label: Prise -description: '' +description: 'between 0 to 100' required: false translatable: false default_value: diff --git a/src/web/modules/custom/ouatt_graphql/graphql/ouatt_extension.base.graphqls b/src/web/modules/custom/ouatt_graphql/graphql/ouatt_extension.base.graphqls index aa0ad25..ed33131 100644 --- a/src/web/modules/custom/ouatt_graphql/graphql/ouatt_extension.base.graphqls +++ b/src/web/modules/custom/ouatt_graphql/graphql/ouatt_extension.base.graphqls @@ -13,13 +13,15 @@ type Concernement implements NodeInterface { path: String! author: String texte: String + recit: Filefield entites: [Entiteintegre] } type Entiteintegre { entite: Entite - rayon: Float - angle: Float + actuelfuture: Int + menacemaintien: Float + prise: Float } type Entite implements NodeInterface { @@ -31,7 +33,7 @@ type Entite implements NodeInterface { author: String texte: String images: [Image] - fichiers: [File] + fichiers: [Filefield] liens: [Link] } diff --git a/src/web/modules/custom/ouatt_graphql/src/Plugin/GraphQL/SchemaExtension/OuattSchemaExtension.php b/src/web/modules/custom/ouatt_graphql/src/Plugin/GraphQL/SchemaExtension/OuattSchemaExtension.php index dc1a0fb..811ca46 100644 --- a/src/web/modules/custom/ouatt_graphql/src/Plugin/GraphQL/SchemaExtension/OuattSchemaExtension.php +++ b/src/web/modules/custom/ouatt_graphql/src/Plugin/GraphQL/SchemaExtension/OuattSchemaExtension.php @@ -173,6 +173,23 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase { ->map('entity', $builder->fromParent()) )); + // $registry->addFieldResolver('Concernement', 'recit', + // $builder->produce('entity_reference') + // ->map('entity', $builder->fromParent()) + // ->map('field', $builder->fromValue('field_recit')) + // ); + + $registry->addFieldResolver('Concernement', 'recit', + $builder->compose( + $builder->produce('property_path') + ->map('type', $builder->fromValue('entity:node')) + ->map('value', $builder->fromParent()) + ->map('path', $builder->fromValue('field_recit')), + $builder->produce('seek') + ->map('input', $builder->fromParent()) + ->map('position', $builder->fromValue(0)) + )); + $registry->addFieldResolver('Concernement', 'entites', $builder->produce('entity_reference_revisions') ->map('entity', $builder->fromParent()) @@ -198,19 +215,26 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase { }) )); - $registry->addFieldResolver('Entiteintegre', 'rayon', + $registry->addFieldResolver('Entiteintegre', 'actuelfuture', $builder->produce('property_path') ->map('type', $builder->fromValue('entity:paragraph')) ->map('value', $builder->fromParent()) - ->map('path', $builder->fromValue('field_rayon.value')) + ->map('path', $builder->fromValue('field_actuel_future.value')) ); - $registry->addFieldResolver('Entiteintegre', 'angle', + $registry->addFieldResolver('Entiteintegre', 'menacemaintien', $builder->produce('property_path') ->map('type', $builder->fromValue('entity:paragraph')) ->map('value', $builder->fromParent()) - ->map('path', $builder->fromValue('field_angle.value')) + ->map('path', $builder->fromValue('field_menace_maintien_degres.value')) ); + + $registry->addFieldResolver('Entiteintegre', 'prise', + $builder->produce('property_path') + ->map('type', $builder->fromValue('entity:paragraph')) + ->map('value', $builder->fromParent()) + ->map('path', $builder->fromValue('field_prise.value')) + ); } // _____ _ _ _