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 { type Besoin implements NodeInterface {
id: Int! id: Int!
path: String! path: String!
author: String
description: String! description: String!
index: Int index: Int
concernement: Concernement concernement: Concernement
@ -76,6 +77,7 @@ type Besoin implements NodeInterface {
type Reponse implements NodeInterface { type Reponse implements NodeInterface {
id: Int! id: Int!
path: String! path: String!
author: String
besoin: Besoin besoin: Besoin
qui: String qui: String
quoi: 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! // description: String!
$registry->addFieldResolver('Besoin', 'description', $registry->addFieldResolver('Besoin', 'description',
$builder->produce('property_path') $builder->produce('property_path')
@ -680,6 +688,15 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
->map('url', $builder->fromParent()) ->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 // besoin: Besoin
$registry->addFieldResolver('Reponse', 'besoin', $registry->addFieldResolver('Reponse', 'besoin',
$builder->compose( $builder->compose(