{"id":18821172,"url":"https://github.com/compwright/graphql-php-jetpack","last_synced_at":"2026-05-01T02:34:57.424Z","repository":{"id":220221954,"uuid":"751080418","full_name":"compwright/graphql-php-jetpack","owner":"compwright","description":"Easily implement custom scalars and directives with webonyx/graphql-php","archived":false,"fork":false,"pushed_at":"2025-01-30T18:51:45.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-28T18:27:47.371Z","etag":null,"topics":["directive","graphql","graphql-php","scalar"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/compwright/graphql-php-jetpack","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/compwright.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["compwright"]}},"created_at":"2024-01-31T22:15:58.000Z","updated_at":"2025-06-30T20:20:56.000Z","dependencies_parsed_at":"2024-11-08T00:36:38.060Z","dependency_job_id":"d9d15b3d-ed50-47ba-875b-ead363685f70","html_url":"https://github.com/compwright/graphql-php-jetpack","commit_stats":null,"previous_names":["compwright/graphql-php-jetpack"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/compwright/graphql-php-jetpack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compwright%2Fgraphql-php-jetpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compwright%2Fgraphql-php-jetpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compwright%2Fgraphql-php-jetpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compwright%2Fgraphql-php-jetpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/compwright","download_url":"https://codeload.github.com/compwright/graphql-php-jetpack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compwright%2Fgraphql-php-jetpack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32483406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["directive","graphql","graphql-php","scalar"],"created_at":"2024-11-08T00:35:18.519Z","updated_at":"2026-05-01T02:34:57.405Z","avatar_url":"https://github.com/compwright.png","language":"PHP","funding_links":["https://github.com/sponsors/compwright"],"categories":[],"sub_categories":[],"readme":"# graphql-php-jetpack\n\nUnlock new [graphql-php](https://github.com/webonyx/graphql-php) superpowers with Jetpack scalar and directive support\n\n[![Validate](https://github.com/compwright/graphql-php-jetpack/actions/workflows/validate.yml/badge.svg)](https://github.com/compwright/graphql-php-jetpack/actions/workflows/validate.yml)\n[![GitHub license](https://img.shields.io/github/license/compwright/graphql-php-jetpack.svg)](https://github.com/compwright/graphql-php-jetpack/blob/master/LICENSE)\n[![Packagist](https://img.shields.io/packagist/v/compwright/graphql-php-jetpack.svg)](https://packagist.org/packages/compwright/graphql-php-jetpack)\n[![Packagist](https://img.shields.io/packagist/dt/compwright/graphql-php-jetpack.svg)](https://packagist.org/packages/compwright/graphql-php-jetpack)\n\n## Features\n\n* Improve your GraphQL schema validation with custom scalars\n* Post-process resolved field values with directives\n\n## Installation\n\n```\n$ composer require compwright/graphql-php-jetpack\n```\n\n## Usage\n\nInstall Jetpack schema support at schema build time:\n\n```php\nuse Compwright\\GraphqlPhpJetpack\\JetpackDecorator;\nuse GraphQL\\Utils\\BuildSchema;\n\n$schemaTypeDecorator = new JetpackDecorator();\n$schema = BuildSchema::build($ast, $schemaTypeDecorator);\n```\n\nInstall Jetpack directive support at server config build time:\n\n```php\nuse Compwright\\GraphqlPhpJetpack\\DirectiveResolver;\nuse GraphQL\\Server\\ServerConfig;\nuse GraphQL\\Type\\Definition\\ResolveInfo;\n\n$resolver = function ($root, array $args, $context, ResolveInfo $info) {\n    // resolve field value\n    return $root;\n};\n\n$serverConfig = ServerConfig::create()\n    -\u003esetFieldResolver(new DirectiveResolver($resolver));\n```\n\nDeclare the directives and scalars you wish to use in your schema, and call them where desired:\n\n```graphql\ndirective @uppercase on FIELD_DEFINITION\n\nscalar Email\n\ntype User {\n    email: Email! @uppercase\n}\n\ntype Query {\n    user: User!\n}\n```\n\n## Jetpack Scalars\n\nYou can use the provided Scalars just like any other type in your schema definition.\n\n### scalar BigInt\n\nAn arbitrarily long sequence of digits that represents a big integer.\n\n### scalar Date\n\nA date string with format `Y-m-d`, e.g. `2011-05-23`.\n\nThe following conversion applies to all date scalars:\n\n- Outgoing values can either be valid date strings or `\\DateTimeInterface` instances.\n- Incoming values must always be valid date strings and will be converted to `\\DateTimeImmutable` instances.\n\n### scalar DateTime\n\nA datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`.\n\n### scalar DateTimeTz\n\nA datetime string with format `Y-m-d\\TH:i:s.uP`, e.g. `2020-04-20T16:20:04+04:00`, `2020-04-20T16:20:04Z`.\n\n### scalar Email\n\nA [RFC 5321](https://tools.ietf.org/html/rfc5321) compliant email.\n\n### scalar JSON\n\nArbitrary data encoded in JavaScript Object Notation. See https://www.json.org.\n\nThis expects a string in JSON format, not a GraphQL literal.\n\n```graphql\ntype Query {\n  foo(bar: JSON!): JSON!\n}\n\n# Wrong, the given value is a GraphQL literal object\n{\n  foo(bar: { baz: 2 })\n}\n\n# Correct, the given value is a JSON string representing an object\n{\n  foo(bar: \"{ \\\"bar\\\": 2 }\")\n}\n```\n\nJSON responses will contain nested JSON strings.\n\n```json\n{\n  \"data\": {\n    \"foo\": \"{ \\\"bar\\\": 2 }\"\n  }\n}\n```\n\n### scalar Latitude\n\nAny number between -90 and 90 degrees.\n\n### scalar Longitude\n\nAny number between -180 and 180 degrees.\n\n### scalar Mixed\n\nLoose type that allows any value. Be careful when passing in large `Int` or `Float` literals,\nas they may not be parsed correctly on the server side. Use `String` literals if you are\ndealing with really large numbers to be on the safe side.\n\n### scalar Null\n\nAlways `null`. Strictly validates value is non-null, no coercion.\n\n### scalar UsState\n\nAny valid two-character US State abbreviation.\n\n### scalar UsZipCode\n\nFive digits, optionally followed by a dash and four additional digits.\n\n## Jetpack Directives\n\n### directive @callback(fn: String!) on FIELD_DEFINITION\n\nExecute a function on the resolved value\n\n### directive @lowercase on FIELD_DEFINITION\n\nTransform resolved text lowercase\n\n### directive @uppercase on FIELD_DEFINITION\n\nTransform resolved text uppercase\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompwright%2Fgraphql-php-jetpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompwright%2Fgraphql-php-jetpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompwright%2Fgraphql-php-jetpack/lists"}