{"id":19691207,"url":"https://github.com/axtiva/flexible-graphql-php","last_synced_at":"2025-10-11T06:39:54.495Z","repository":{"id":41251362,"uuid":"417790589","full_name":"axtiva/flexible-graphql-php","owner":"axtiva","description":"Schema SDL first lib for generate php code from graphql sdl to TypeRegistry with webonyx/graphql-php","archived":false,"fork":false,"pushed_at":"2024-11-10T11:08:06.000Z","size":171,"stargazers_count":13,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-12T17:08:06.405Z","etag":null,"topics":["apollo-federation","apollo-federation-subgrapgh","code-generation","graphql","graphql-server","php","sdl"],"latest_commit_sha":null,"homepage":"","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/axtiva.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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}},"created_at":"2021-10-16T10:13:08.000Z","updated_at":"2024-10-21T06:48:10.000Z","dependencies_parsed_at":"2024-11-11T19:08:27.635Z","dependency_job_id":"53d541ca-53f0-4dbc-aa2e-26cee8f5cda0","html_url":"https://github.com/axtiva/flexible-graphql-php","commit_stats":{"total_commits":22,"total_committers":2,"mean_commits":11.0,"dds":"0.045454545454545414","last_synced_commit":"874b5a725bfddfc072f7de744120fe8dc190cbe9"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/axtiva/flexible-graphql-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axtiva%2Fflexible-graphql-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axtiva%2Fflexible-graphql-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axtiva%2Fflexible-graphql-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axtiva%2Fflexible-graphql-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axtiva","download_url":"https://codeload.github.com/axtiva/flexible-graphql-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axtiva%2Fflexible-graphql-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006451,"owners_count":26084107,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"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":["apollo-federation","apollo-federation-subgrapgh","code-generation","graphql","graphql-server","php","sdl"],"created_at":"2024-11-11T19:08:24.259Z","updated_at":"2025-10-11T06:39:54.475Z","avatar_url":"https://github.com/axtiva.png","language":"PHP","readme":"# Axtiva Flexible Graphql\n\nSchema first lib for generate php code from graphql sdl to TypeRegistry whom support [webonyx/graphql-php](https://github.com/webonyx/graphql-php) with simple integrate to any controller.\n\n## TL;DR\n\nCan easy to integrate graphql to any project, all you need is controller. Fast start with [example](./example/TEST.md)\n\n## Features:\n\n- Schema/SDL first code generation (look at [example dir](./example/generate_code.php))\n- Support all features from [webonyx/graphql-php](https://github.com/webonyx/graphql-php)\n- Executable directives\n- Apollo Federation/Federation2 support\n- Popular framework integration:\n  + Symfony [axtiva/flexible-graphql-bundle](//github.com/axtiva/flexible-graphql-bundle)\n\n# Setup\n\nComposer install:\n\n```\ncomposer require axtiva/flexible-graphql-php\n```\n\n## Examples:\n\n- Generate models by types in Graphql Schema [example/generate_type_models.php](./example/generate_type_models.php)\n- Generate custom scalar resolver by Graphql Schema [example/generate_scalar_resolver.php](./example/generate_scalar_resolver.php)\n- Generate directive resolver by Graphql Schema [example/generate_directive_resolver.php](./example/generate_directive_resolver.php)\n- Generate type field resolver by Graphql Schema [example/generate_field_resolver.php](./example/generate_field_resolver.php)\n- Create lazy loaded TypeRegistry [example/generate_type_registry.php](./example/generate_type_registry.php)\n- Setup graphql request handler with lazy loaded TypeRegistry [example/start_graphql_server.php](./example/start_graphql_server.php)\n\n## Demo\n\nUp Dev server for test http Graphql requests:\n\n```shell\nphp -S localhost:8080 example/start_graphql_server.php\n```\n\n### Change [schema](example/schema.graphql) and run example commands\n \nUpdate TypeRegistry and model classes from schema and resolvers map:\n\n```shell\nphp example/generate_code.php\n```\n\nIf you need to make field resolver, then remove AutoGenerationInterface from model [CodedCurrencyType](example/GraphQL/Model/CodedCurrencyType.php)\n\nExample:\n\n```diff\n- final class CodedCurrencyType implements AutoGenerationInterface, NodeInterface, CurrencyInterface\n+ final class CodedCurrencyType implements NodeInterface, CurrencyInterface\n{\n    public string $id;\n-   public int $code;\n}\n```\n\nand run `php example/generate_code.php`, after this you will find in [example/Resolver/CodedCurrency/CodeResolver.php](example/Resolver/CodedCurrency/CodeResolver.php).\nthis is your field resolver, define him in your psr container like PsrContainerExample in [example/start_graphql_server.php](example/start_graphql_server.php):\n\n```diff\n$container = new PsrContainerExample([\n    \\Axtiva\\FlexibleGraphql\\Example\\GraphQL\\Resolver\\Query\\AccountResolver::class =\u003e\n        new \\Axtiva\\FlexibleGraphql\\Example\\GraphQL\\Resolver\\Query\\AccountResolver,\n+   \\Axtiva\\FlexibleGraphql\\Example\\GraphQL\\Resolver\\CodedCurrency\\CodeResolver::class =\u003e\n+       new \\Axtiva\\FlexibleGraphql\\Example\\GraphQL\\Resolver\\CodedCurrency\\CodeResolver,\n]);\n```\n\nRun demo app `php -S localhost:8080 example/start_graphql_server.php` and try request CodedCurrency.code field in query \n\n## Tests\n\nRun tests\n\n```\nphp vendor/bin/phpunit \n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxtiva%2Fflexible-graphql-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxtiva%2Fflexible-graphql-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxtiva%2Fflexible-graphql-php/lists"}