From 7fd485610bb2b259192018a56a6d98859a8b8160 Mon Sep 17 00:00:00 2001 From: bach Date: Wed, 12 Feb 2025 17:10:50 +0100 Subject: [PATCH] added id and revision_id to doleance paragraph gql querys --- .../graphql/ouatt_extension.base.graphqls | 8 +++ .../SchemaExtension/OuattSchemaExtension.php | 57 +++++++++++++++++++ 2 files changed, 65 insertions(+) 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 8f59994..d306020 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 @@ -151,6 +151,8 @@ type Doleance implements NodeInterface { } type GroupeInterets { + id: Int + revision_id: Int date: Date groupe_interets: String accorder_interets: String @@ -158,6 +160,8 @@ type GroupeInterets { } type ReceptionTraitement { + id: Int + revision_id: Int date: Date entite_adressee: String doleance_formulee: String @@ -166,6 +170,8 @@ type ReceptionTraitement { } type MiseEnoeuvreDecision { + id: Int + revision_id: Int date: Date entite_adresse_decision: String formule_decision: String @@ -173,6 +179,8 @@ type MiseEnoeuvreDecision { } type ReceptionsApplications { + id: Int + revision_id: Int date: Date applique_decision: String formule_decision_applic: String 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 ae92f43..bc286d8 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 @@ -1210,6 +1210,20 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase { // |_| protected function addGroupeInterets(ResolverRegistryInterface $registry, ResolverBuilder $builder) { + $registry->addFieldResolver('GroupeInterets', 'id', + $builder->produce('entity_id') + ->map('entity', $builder->fromParent()) + ); + + $registry->addFieldResolver('GroupeInterets', 'revision_id', + $builder->compose( + $builder->callback(function($parent, $arg){ + $revid = $parent->getRevisionId(); + return $revid; + }) + ) + ); + // field_date_groupe_interets: Date $registry->addFieldResolver('GroupeInterets', 'date', $builder->produce('property_path') @@ -1247,6 +1261,21 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase { // |_| \_\___|\___\___| .__/ \__|_|\___/|_| |_| |_||_| \__,_|_|\__\___|_| |_| |_|\___|_| |_|\__| // |_| protected function addReceptionTraitement(ResolverRegistryInterface $registry, ResolverBuilder $builder) { + + $registry->addFieldResolver('ReceptionTraitement', 'id', + $builder->produce('entity_id') + ->map('entity', $builder->fromParent()) + ); + + $registry->addFieldResolver('ReceptionTraitement', 'revision_id', + $builder->compose( + $builder->callback(function($parent, $arg){ + $revid = $parent->getRevisionId(); + return $revid; + }) + ) + ); + // field_date_reception_traite: Date $registry->addFieldResolver('ReceptionTraitement', 'date', $builder->produce('property_path') @@ -1290,6 +1319,20 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase { // | | | | \__ \ __/ | |___| | | | (_) | __/ |_| |\ V /| | | __/ | |_| | __/ (__| \__ \ | (_) | | | | // |_| |_|_|___/\___| |_____|_| |_|\___/ \___|\__,_| \_/ |_| \___| |____/ \___|\___|_|___/_|\___/|_| |_| protected function addMiseEnoeuvreDecision(ResolverRegistryInterface $registry, ResolverBuilder $builder) { + + $registry->addFieldResolver('MiseEnoeuvreDecision', 'id', + $builder->produce('entity_id') + ->map('entity', $builder->fromParent()) + ); + + $registry->addFieldResolver('MiseEnoeuvreDecision', 'revision_id', + $builder->compose( + $builder->callback(function($parent, $arg){ + $revid = $parent->getRevisionId(); + return $revid; + }) + ) + ); // field_date_miseeoeuvre_decision: Date $registry->addFieldResolver('MiseEnoeuvreDecision', 'date', $builder->produce('property_path') @@ -1327,6 +1370,20 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase { // |_| \_\___|\___\___| .__/ \__|_|\___/|_| |_|___/ /_/ \_\ .__/| .__/|_|_|\___\__,_|\__|_|\___/|_| |_|___/ // |_| |_| |_| protected function addReceptionsApplications(ResolverRegistryInterface $registry, ResolverBuilder $builder) { + + $registry->addFieldResolver('ReceptionsApplications', 'id', + $builder->produce('entity_id') + ->map('entity', $builder->fromParent()) + ); + + $registry->addFieldResolver('ReceptionsApplications', 'revision_id', + $builder->compose( + $builder->callback(function($parent, $arg){ + $revid = $parent->getRevisionId(); + return $revid; + }) + ) + ); // field_date_date_traitement_decis: Date $registry->addFieldResolver('ReceptionsApplications', 'date', $builder->produce('property_path')