Download the PHP package almservices/attributed-graphql-model-types without Composer
On this page you can find all versions of the php package almservices/attributed-graphql-model-types. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download almservices/attributed-graphql-model-types
More information about almservices/attributed-graphql-model-types
Files in almservices/attributed-graphql-model-types
Package attributed-graphql-model-types
Short Description Attribute based graphql model/types
License MIT
Informations about the package attributed-graphql-model-types
Attributed GraphQL model types
Requirements
- Composer
- PHP >=7.4
Installation
composer require almservices/attributed-graphql-model-types
Usage
Given we have such model
or with php7.4
We can create GraphQL type by
or directly by
which will be equivalent to
Model Examples
Field
Alias
Enum
PHP 8.1
inline version for PHP < 8.1
other options are:
Ignoring specific fields:
Lists
for non-nullable items use NonNull
Value Object
Legacy or custom Value Objects that can be cast to string, can be used as model property
example:
but if value is more complex it can become resolved on demand
Deprecated
Description
More on resolvers
Example with objective input type
Example of fully qualified resolver
Demo
To run demo execute
php -S 127.0.0.1:8000 demo/index.php
curl 127.0.0.1:8000 -d '{"query": "{myUser{id firstName lastName}}"}' -H "Content-Type: application/json" -H 'Authorization: dev'
All versions of attributed-graphql-model-types with dependencies
ext-mbstring Version *
nette/php-generator Version ^3.6.6
webonyx/graphql-php Version ^v14.0.0