added superposition, proximite and agissante fields o graphql
This commit is contained in:
		@@ -34,6 +34,9 @@ type Entite implements NodeInterface {
 | 
			
		||||
  author: String
 | 
			
		||||
  action: String
 | 
			
		||||
  menacemaintien: String
 | 
			
		||||
  superposition: [Entite]
 | 
			
		||||
  proximite: [Entite]
 | 
			
		||||
  agissante: Boolean
 | 
			
		||||
  sources: [Source]
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -330,7 +330,30 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
 | 
			
		||||
        $builder->produce('entity_bundle')
 | 
			
		||||
          ->map('entity', $builder->fromParent())
 | 
			
		||||
      ));
 | 
			
		||||
    
 | 
			
		||||
    // superposition: [Entite]
 | 
			
		||||
    $registry->addFieldResolver('Entite', 'superposition',
 | 
			
		||||
      $builder->produce('entity_reference')
 | 
			
		||||
        ->map('entity', $builder->fromParent())
 | 
			
		||||
        ->map('field', $builder->fromValue('field_superposition'))
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    // proximite: [Entite]
 | 
			
		||||
    $registry->addFieldResolver('Entite', 'proximite',
 | 
			
		||||
      $builder->produce('entity_reference')
 | 
			
		||||
        ->map('entity', $builder->fromParent())
 | 
			
		||||
        ->map('field', $builder->fromValue('field_proximite'))
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    // agissante: Boolean
 | 
			
		||||
    $registry->addFieldResolver('Entite', 'agissante',
 | 
			
		||||
      $builder->produce('property_path')
 | 
			
		||||
        ->map('type', $builder->fromValue('entity:node'))
 | 
			
		||||
        ->map('value', $builder->fromParent())
 | 
			
		||||
        ->map('path', $builder->fromValue('field_entite_agissante.value'))
 | 
			
		||||
      );
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
    $registry->addFieldResolver('Entite', 'action',
 | 
			
		||||
      $builder->produce('property_path')
 | 
			
		||||
        ->map('type', $builder->fromValue('entity:node'))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user