Graphpinator Nette
Introduction
This package includes adapters for various Graphpinator functionalities and a SchemaPresenter, which returns a response with generated GraphQL type language document.
Installation
Install package using composer
composer require infinityloop-dev/graphpinator-nette
How to use
Adapters
\Graphpinator\Nette\TracyLogger
- Implements logger interface for loggin in
\Graphpinator\Graphpinator
.
- Implements logger interface for loggin in
\Graphpinator\Nette\NetteRequestFactory
- Implements RequestFactory and enables direct creation of
\Graphpinator\Request\Request
from Nette HTTP abstraction.
- Implements RequestFactory and enables direct creation of
\Graphpinator\Nette\FileProvider
- Implements FileProvider interface needed by
infinityloop-dev/graphpinator-upload
module.
- Implements FileProvider interface needed by
\Graphpinator\Nette\NetteCache
- Adapter from Nette Caching to Psr CacheInterface needed by
infinityloop-dev/graphpinator-persisted-queries
module.
- Adapter from Nette Caching to Psr CacheInterface needed by
SchemaPresenter
Schema presenter contains two actions.
- actionHtml, which renders HTML page
- actionFile, which renders text file - file is sent to browser as an attachment, which tells the browser to show the download prompt
Action can be enabled using Router, here is the example which enables the HTML action on the /schema.graphql
path.
$router[] = new Route('/schema.graphql',
'module' => 'Graphpinator',
'presenter' => 'Schema',
'action' => 'html',
]);
It is also required to register the application-module to correct namespace.
application:
mapping:
Graphpinator: 'Graphpinator\Nette\*Presenter'