Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Class

rawname/API/Gql/Modulename.php
<?php

namespace FreePBX\modules\Parking\Api\Gql;

use GraphQL\Type\Definition\Type;
use FreePBX\modules\Api\Gql\Base;

class Modulename extends Base { 
	public function constructQuery() {
    	return array(
			'foo' => array(
				'type' => $this->typeContainer->get('foo')->getListReference(),
				'resolve' => function($root,$args){
					return $this->freepbx->Mymodule->doFoo();
				}
			)
		);
	}
	public function postInitReferences() {
		$foo = $this->typeContainer->get('foo');
		$foo-addFields(
			array(
				'bar' => array(
					'type' => $this->typeContainer->get('bar')->getReference()
				);
			)
		);
	}
	public function initReferences(){
		$foo = $this->typeContainer->get('foo');
		$foo->addFields(array(
			'bar' => array(
				'type' => Type::string();
			)	
		));


	}
}

Types

Type::string()

Type::id()

Type::int()

Type::boolean()

  • No labels