Download the PHP package cis-bv/gql-builder without Composer

On this page you can find all versions of the php package cis-bv/gql-builder. 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 gql-builder

PHP GraphQL Query-Builder

Inspired by the Builder-Part of the PHP GraphQL Client by mghonemiy this builder provides a simple way to generate Graph-QL-Queries and provide the string.

This library don't include any Client or Response-Decoding functionality and requires the handling of Client-Request and -Responses separately.

Installation

Usage

The main entry point for usage is the Query-class. You can simply create a Query with either a static or typical instantiate call.

Create a Query

To create a simple query (here querying a device_list and retrieve id and name of each device) you have three ways:

The example above will create the following query:

If you set the Pretty-Flag:

The query will have a pretty output:

Please keep in mind that these examples are the easiest implementation that it is possible and the "global" query will only be set if scalar fields are within the Selection-Set.

The clean and correct way (and also a more complex example) will be the generation of an "empty" root-query and define all Queries within the selection set:

The example above also includes Arguments for Filtering (here a more complex FilterQueryType) and using a Variable.

The following query (when set to Pretty Print) will be generated and is a real life example for a Strawberry GraphQL-Endpoint:

Static Query-Builder

Within a selection Set you generally can create a new Query with the following code:

But you can also use a static build:

This is a short version and will return a new Query Instance.

Earlier we also have seen the Query::create(...$parameters) statement. Another Advantage of this call is that Variables can be easily created as Arrays without the new Variable(...$parameters) statement.

For easier understanding the named parameter style of PHP8 is used:


All versions of gql-builder with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
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 cis-bv/gql-builder contains the following files

Loading the files please wait ....