Download the PHP package odder/lighthouse-scalars without Composer
On this page you can find all versions of the php package odder/lighthouse-scalars. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download odder/lighthouse-scalars
More information about odder/lighthouse-scalars
Files in odder/lighthouse-scalars
Package lighthouse-scalars
Short Description A collection of custom scalar types for usage with https://github.com/webonyx/graphql-php
License MIT
Informations about the package lighthouse-scalars
Lighthouse Scalars
This package provides a set of custom scalars for the webonyx/graphql-php library, which is used under the hood by Lighthouse, a PHP port of the popular GraphQL server.
Supported Scalars
The following scalars are supported:
😍😍😍:
Emoji
- see Emoji
Numbers:
PositiveFloat
- see Positive numberNegativeFloat
- see Negative numberPositiveInt
- see Positive integerNegativeInt
Localization:
CurrencyCode
- see ISO 4217 alpha-3CountryCode
- see ISO 3166-1 alpha-2Email
- see RFC 5322LanguageCode
- see ISO 639-1Locale
- Simple locale string. see Locale (en
,en-US
,en-GB
,fr
,fr-FR
,fr-CA
, etc.)
Geography:
Latitude
- Extends GeoCoordinate. see LatitudeLongitude
- Extends GeoCoordinate. see LongitudeGeoCoordinate
- see Geographic coordinate systemCountryCode
- see ISO 3166-1 alpha-2
Internet:
URL
- see URLURI
- see URIIPv4
- see IPv4IPv6
- see IPv6SemVer
- see Semantic VersioningUUID
- Using UUID4. see UUID
Markup:
JSON
- see JSONHTML
- Sanitised using HTML Purifier to prevent XSS attacks. see HTMLMarkdown
- see Markdown
Installation
You can install the package via composer:
Usage
Using Lighthouse
You can opt-in to the scalars you want by registering them in the TypeRegistry
in a service provider. For example, you can register the PositiveFloat
and Emoji
scalars in the AppServiceProvider
:
After you have registered the Scalars you need in the TypeRegistry
, you can use them in your schema:
Testing
This package includes a set of tests for each scalar. To run the tests, use the following command:
Documentation
For more information on how to use each scalar, please refer to the documentation.
Contributing
Contributions are welcome! Please read CONTRIBUTING.md for details on how to contribute to this project.
License
The MIT License (MIT). Please see License File for more information.
Credits
- Odder
- All Contributors
- webonyx/graphql-php
- Lighthouse
- Laravel
- GraphQL
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
All versions of lighthouse-scalars with dependencies
webonyx/graphql-php Version ^15
ezyang/htmlpurifier Version ^4.17
p3k/emoji-detector Version ^1.0
nesbot/carbon Version ^3.0