added author on gql puissance d'agir

This commit is contained in:
Bachir Soussi Chiadmi 2023-05-17 15:38:21 +02:00
parent cd91067f16
commit 180436dfce
2 changed files with 19 additions and 0 deletions

View File

@ -67,6 +67,7 @@ type Etape {
type Besoin implements NodeInterface {
id: Int!
path: String!
author: String
description: String!
index: Int
concernement: Concernement
@ -76,6 +77,7 @@ type Besoin implements NodeInterface {
type Reponse implements NodeInterface {
id: Int!
path: String!
author: String
besoin: Besoin
qui: String
quoi: String

View File

@ -585,6 +585,14 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
)
);
$registry->addFieldResolver('Besoin', 'author',
$builder->compose(
$builder->produce('entity_owner')
->map('entity', $builder->fromParent()),
$builder->produce('entity_label')
->map('entity', $builder->fromParent())
));
// description: String!
$registry->addFieldResolver('Besoin', 'description',
$builder->produce('property_path')
@ -680,6 +688,15 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
->map('url', $builder->fromParent())
)
);
$registry->addFieldResolver('Reponse', 'author',
$builder->compose(
$builder->produce('entity_owner')
->map('entity', $builder->fromParent()),
$builder->produce('entity_label')
->map('entity', $builder->fromParent())
));
// besoin: Besoin
$registry->addFieldResolver('Reponse', 'besoin',
$builder->compose(