Download the PHP package mll-lab/graphql-php-scalars without Composer

On this page you can find all versions of the php package mll-lab/graphql-php-scalars. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

Please rate this library. Is it a good library?

All versions of graphql-php-scalars with dependencies

Informations about the package graphql-php-scalars

graphql-php-scalars

A collection of custom scalar types for usage with https://github.com/webonyx/graphql-php

Continuous Integration codecov StyleCI

GitHub license Packagist Packagist

Installation

composer require mll-lab/graphql-php-scalars

Usage

You can use the provided Scalars just like any other type in your schema definition. Check SchemaUsageTest for an example.

Email

A RFC 5321 compliant email.

JSON

Arbitrary data encoded in JavaScript Object Notation. See https://www.json.org/.

Mixed

Loose type that allows any value. Be careful when passing in large Int or Float literals, as they may not be parsed correctly on the server side. Use String literals if you are dealing with really large numbers to be on the safe side.

Regex

The Regex class allows you to define a custom scalar that validates that the given value matches a regular expression.

The quickest way to define a custom scalar is the make factory method. Just provide a name and a regular expression and you will receive a ready-to-use custom regex scalar.

You may also define your regex scalar as a class.

StringScalar

The StringScalar encapsulates all the boilerplate associated with creating a string-based Scalar type. It does the proper string checking for you and let's you focus on the minimal logic that is specific to your use case.

All you have to specify is a function that checks if the given string is valid. Use the factory method make to generate an instance on the fly.

Or you may simply extend the class, check out the implementation of the Email scalar to see how.


Version
Requires php Version ^7.2 || ^8.0
ext-json Version *
egulias/email-validator Version ^2.1.17
spatie/regex Version ^1.4.1
thecodingmachine/safe Version ^1.0.3
webonyx/graphql-php Version ^0.13.8 || ^14

The package mll-lab/graphql-php-scalars contains the following files

Loading the files please wait ....