{"id":18929490,"url":"https://github.com/thecodingmachine/graphqlite-misc-types","last_synced_at":"2025-04-15T15:31:03.296Z","repository":{"id":48369441,"uuid":"183650193","full_name":"thecodingmachine/graphqlite-misc-types","owner":"thecodingmachine","description":"A collection of non-standard GraphQL types to be used with GraphQLite.","archived":false,"fork":false,"pushed_at":"2022-04-27T10:35:28.000Z","size":20,"stargazers_count":1,"open_issues_count":7,"forks_count":5,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-11T18:59:48.054Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thecodingmachine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-26T15:13:11.000Z","updated_at":"2023-02-15T21:40:44.000Z","dependencies_parsed_at":"2022-09-06T06:51:10.103Z","dependency_job_id":null,"html_url":"https://github.com/thecodingmachine/graphqlite-misc-types","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fgraphqlite-misc-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fgraphqlite-misc-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fgraphqlite-misc-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fgraphqlite-misc-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecodingmachine","download_url":"https://codeload.github.com/thecodingmachine/graphqlite-misc-types/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249097859,"owners_count":21212362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T11:32:59.446Z","updated_at":"2025-04-15T15:31:03.039Z","avatar_url":"https://github.com/thecodingmachine.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest Stable Version](https://poser.pugx.org/thecodingmachine/graphqlite-misc-types/v/stable)](https://packagist.org/packages/thecodingmachine/graphqlite-misc-types)\n[![Total Downloads](https://poser.pugx.org/thecodingmachine/graphqlite-misc-types/downloads)](https://packagist.org/packages/thecodingmachine/graphqlite-misc-types)\n[![Latest Unstable Version](https://poser.pugx.org/thecodingmachine/graphqlite-misc-types/v/unstable)](https://packagist.org/packages/thecodingmachine/graphqlite-misc-types)\n[![License](https://poser.pugx.org/thecodingmachine/graphqlite-misc-types/license)](https://packagist.org/packages/thecodingmachine/graphqlite-misc-types)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/thecodingmachine/graphqlite-misc-types/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/thecodingmachine/graphqlite-misc-types/?branch=master)\n[![Build Status](https://travis-ci.org/thecodingmachine/graphqlite-misc-types.svg?branch=master)](https://travis-ci.org/thecodingmachine/graphqlite-misc-types)\n[![Coverage Status](https://coveralls.io/repos/thecodingmachine/graphqlite-misc-types/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/thecodingmachine/graphqlite-misc-types?branch=master)\n\n# GraphQLite miscellaneous types\n\nThis package is an add-on to the [GraphQLite](http://graphqlite.thecodingmachine.io/) PHP library.\nIt contains a set of GraphQL scalar types that can be added to GraphQLite.\n\n## Install\n\n```console\n$ composer require thecodingmachine/graphqlite-misc-types\n```\n\n## \"Any\" scalar type\n\nThis types adds support for a \"AnyScalar\" type that can be any of \"string\", \"int\", \"float\" or \"bool\".\n\n### Usage\n\n```php\n/**\n * @Query()\n * @param scalar $scalar\n * @return scalar\n */\npublic function echoScalar($scalar)\n{\n    return $scalar;\n}\n```\n\nUse the \"scalar\" type-hint in the DocBlock to cast a value to \"AnyScalar\".\n\n### Registering AnyScalar\n\n#### Using the SchemaFactory\n\nIf you are using the `SchemaFactory` to initialize GraphQLite, use this code to add support for `AnyScalar`:\n\n```php\n$schemaFactory-\u003eaddRootTypeMapper(new \\TheCodingMachine\\GraphQLite\\Types\\AnyScalar\\AnyScalarTypeMapper());\n```\n\n#### Using the Symfony bundle\n\nIf you are using the Symfony bundle to initialize GraphQLite, register the `AnyScalarTypeMapper` as a service:\n\n```yaml\n# config/services.yaml\nservices:\n    TheCodingMachine\\GraphQLite\\Types\\AnyScalar\\AnyScalarTypeMapper:\n        tags: ['graphql.root_type_mapper']\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fgraphqlite-misc-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodingmachine%2Fgraphqlite-misc-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fgraphqlite-misc-types/lists"}