Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHAnderson committed Dec 13, 2023
1 parent 0a5e7fd commit bd86ba0
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ GraphQL Type Driver for Doctrine ORM
[![Total Downloads](https://poser.pugx.org/api-skeletons/doctrine-orm-graphql/downloads)](//packagist.org/packages/api-skeletons/doctrine-orm-graphql)
[![License](https://poser.pugx.org/api-skeletons/doctrine-orm-graphql/license)](//packagist.org/packages/api-skeletons/doctrine-orm-graphql)

* 2023-12-12 - New version 9.0 is released dropping support for PHP 8.0

This library provides a GraphQL driver for Doctrine ORM for use with [webonyx/graphql-php](https://github.com/webonyx/graphql-php).
Configuration is available from simple to verbose. Multiple configurations for multiple drivers are supported.

Expand Down Expand Up @@ -202,12 +204,24 @@ Example

```gql
{
artists ( filter: { name: { contains: "dead" } } ) {
artists (
filter: {
name: {
contains: "dead"
}
}
) {
edges {
node {
id
name
performances ( filter: { venue: { eq: "The Fillmore" } } ) {
performances (
filter: {
venue: {
eq: "The Fillmore"
}
}
) {
edges {
node {
venue
Expand Down Expand Up @@ -236,12 +250,12 @@ Each field has their own set of filters. Most fields have the following:
* endswith - A like query with a wildcard on the left side of the value.
* contains - A like query.

You may [exclude any filter (excludeCriteria)](https://doctrine-orm-graphql.apiskeletons.dev/en/latest/attributes.html#entity) from any entity, association, or globally.
You may [exclude any filter](https://doctrine-orm-graphql.apiskeletons.dev/en/latest/attributes.html#entity) from any entity, association, or globally.

Events
------

### Filter Query Builder
### Query Builder

You may modify the query builder used to resolve any connection by subscribing to events.
Each connection may have a unique event name. `Entity::class . '.filterQueryBuilder'` is recommended.
Expand All @@ -264,13 +278,13 @@ $schema = new Schema([
'filter' => $driver->filter(Artist::class),
'pagination' => $driver->pagination(),
],
'resolve' => $driver->resolve(Artist::class, Artist::class . '.filterQueryBuilder'),
'resolve' => $driver->resolve(Artist::class, Artist::class . '.queryBuilder'),
],
],
]),
]);

$driver->get(EventDispatcher::class)->subscribeTo(Artist::class . '.filterQueryBuilder',
$driver->get(EventDispatcher::class)->subscribeTo(Artist::class . '.queryBuilder',
function(QueryBuilder $event) {
$event->getQueryBuilder()
->innerJoin('entity.user', 'user')
Expand Down

0 comments on commit bd86ba0

Please sign in to comment.