Download the PHP package watafactory/dwh-query-bundle without Composer

On this page you can find all versions of the php package watafactory/dwh-query-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dwh-query-bundle

DWH Query Bundle

About

The DWH uses GraphQL specification to retrieve the data. It uses the package 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 or the documentation of the PHP package.

Installation

Via composer:

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:

Documentation

GraphQL

The main parts of GraphQL are:

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:

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

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

Query

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

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

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

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

This is an example:

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:

Defining resolvers

To define a resolver for a type you need to create a class that implements the interface with two methods:

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

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 and implement the method __invoke

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:

License

See LICENSE.


All versions of dwh-query-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
symfony/config Version ^5.4
symfony/framework-bundle Version ^5.4
symfony/dependency-injection Version ^5.4
symfony/http-kernel Version ^5.4
webonyx/graphql-php Version ^14.11
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package watafactory/dwh-query-bundle contains the following files

Loading the files please wait ....