PHPackages                             watafactory/dwh-query-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. watafactory/dwh-query-bundle

ActiveSymfony-bundle

watafactory/dwh-query-bundle
============================

The DWH uses GraphQL specification to retrieve the data

v1.0.0(3y ago)2151GPL-3.0-or-laterPHPPHP &gt;=7.4

Since Feb 14Pushed 3y agoCompare

[ Source](https://github.com/watafactory/dwh-query-bundle)[ Packagist](https://packagist.org/packages/watafactory/dwh-query-bundle)[ RSS](/packages/watafactory-dwh-query-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (9)Versions (2)Used By (1)

DWH Query Bundle
================

[](#dwh-query-bundle)

About
-----

[](#about)

The DWH uses GraphQL specification to retrieve the data. It uses the package [webonyx/graphql-php](https://github.com/webonyx/graphql-php): a PHP implementation of the GraphQL specification based on the reference implementation in JavaScript to use GraphQL in PHP.

If you want to learn about GraphQL you can read the docs from the official website [Introduction to GraphQL](https://graphql.org/learn/) or the documentation of the PHP package.

Installation
============

[](#installation)

Via composer:

```
composer require watafactory/dwh-query-bundle
```

Development
===========

[](#development)

In case you want to extend the library, you can set up a local installation using docker:

Run `docker-compose up -d` to run app. By default, the `docker-compose.yml` is used.

Run `docker-compose exec apache-php composer install` to install the vendors.

This docker-compose file is used for development. It starts the following container:

- php: it contains the application source code

Documentation
=============

[](#documentation)

GraphQL
-------

[](#graphql)

The main parts of GraphQL are:

### Types

[](#types)

You need to configure the data types where the DWH can use for queries. This is only a specification of what type of query the user can do. For example:

```
type ResultCompany {
    questionCode: String
    block: String
    scaleName: String
    scaleCode: String
    result: String
}

```

With this type defined in GraphQL you can search for the type ResultCompany and retrieve the fields you need.

Using GraphQL-PHP you can set the types as [this](https://webonyx.github.io/graphql-php/data-fetching/)

### Resolver

[](#resolver)

When you query for a type using GraphQL you need to specify how the data is retrieved from the database, api, … or wherever you want.

The resolver is a function that gets the type you are querying and the arguments of you query. With these data you can do a search in the database, api, .. and return an array with the data.

Using GraphQL-PHP you can set the resolvers as [this](https://webonyx.github.io/graphql-php/data-fetching/)

### Query

[](#query)

In order to retrieve the data using GraphQL you have to use a Query. The structure of a query is the following one:

```
{
  human(id: "1000") {
    name
    height
  }
}

```

With this query you are trying to fetch the type “human” where the “id” is 1000 and retrieving only the fields “name” and “height”.

Dwh Query Bundle
----------------

[](#dwh-query-bundle-1)

With this bundle we can define the types we can query, the resolvers to fetch the data, and we have an endpoint to send the queries.

Dwh Query Bundle can be extended using [this bundle](https://github.com/developmentwata/dwh-query-doctrine-bundle)

### Defining types

[](#defining-types)

The bundle will automatically look in the config/dwh\_query folder for all the files with the extension .graphql. Those files have the definition of the schemas using the Schema Definition Language. You can read about this [here](https://webonyx.github.io/graphql-php/schema-definition-language/)

This is an example:

```
type Query {
allCompanyResult(limit: Int!): [CompanyResult]
}
type CompanyResult {
questionCode: String
block: String
scaleName: String
scaleCode: String
result: String
}

```

There is a special type named “Query” that is the root of the other ones.

You can change the schemas directory in the dwh\_query.yaml file:

```
dwh_query:
schemas_dir: '%kernel.project_dir%/config/dwh_query'

```

### Defining resolvers

[](#defining-resolvers)

To define a resolver for a type you need to create a class that implements the interface `Wata\DwhQueryBundle\Resolver\QueryResolverInterface` with two methods:

- getAlias(): it returns the alias for this resolver. The alias must have the same name that the type you are writing the resolver for.
- \_\_invoke(…): it receives the where clauses, the order by fields, the group by fields and an info variable with all the information about the query.

The bundle will automatically search for all the classes that implements this interface, and it will add it to the query resolver.

You can use any service using dependency injection in this class.

### Defining preinterceptors

[](#defining-preinterceptors)

You can define preinterceptors in order to add where clauses to the resolver or performs another type of checks such as permissions.

You only need to create a class that implements the interface `Wata\DwhQueryBundle\Interceptor\PreInterceptorInterface` and implement the method \_\_invoke

### Query endpoint

[](#query-endpoint)

The route for the endpoint is configured in the config/routes/dwh.yaml file.

By default, the endpoint is POST /dwh

You can add a url prefix setting:

```
dwh:
resource: "@DwhQueryBundle/Resources/config/routes.yaml"
prefix: /api

```

License
-------

[](#license)

See [LICENSE](LICENSE).

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1187d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/82c616541ba83e78e78782bb157f6d2b5d80f3db26c9751a643c5ef958ec287c?d=identicon)[watafactory](/maintainers/watafactory)

---

Top Contributors

[![jacaballerowata](https://avatars.githubusercontent.com/u/124883025?v=4)](https://github.com/jacaballerowata "jacaballerowata (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/watafactory-dwh-query-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/watafactory-dwh-query-bundle/health.svg)](https://phpackages.com/packages/watafactory-dwh-query-bundle)
```

###  Alternatives

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

578630.7k1](/packages/scheb-2fa)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
