{"id":18486083,"url":"https://github.com/mathsgod/light-graphql","last_synced_at":"2025-10-29T21:11:17.168Z","repository":{"id":257536155,"uuid":"858596482","full_name":"mathsgod/light-graphql","owner":"mathsgod","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-01T10:07:42.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-06T16:04:06.363Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mathsgod.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2024-09-17T07:29:40.000Z","updated_at":"2025-04-01T10:07:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"c1b72b0f-7f4d-4c12-9a80-d3eac69f08ec","html_url":"https://github.com/mathsgod/light-graphql","commit_stats":null,"previous_names":["mathsgod/light-graphql"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mathsgod/light-graphql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Flight-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Flight-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Flight-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Flight-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathsgod","download_url":"https://codeload.github.com/mathsgod/light-graphql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Flight-graphql/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262422184,"owners_count":23308608,"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-06T12:47:46.296Z","updated_at":"2025-10-29T21:11:17.163Z","avatar_url":"https://github.com/mathsgod.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Light GraphQL\n\nLight GraphQL is a lightweight GraphQL server implementation designed for simplicity and ease of use. This project demonstrates how to set up a basic GraphQL server using PHP.\n\nThis library is built using several dependencies, including `thecodingmachine/graphqlite`, which provides annotations and tools for creating GraphQL APIs in PHP. Other key dependencies include:\n\n- **league/container**: A lightweight dependency injection container.\n- **symfony/cache**: A caching library for optimizing performance.\n\nThese libraries work together to provide a robust and flexible foundation for building GraphQL servers.\n\n## Installation\n\n```\ncomposer require mathsgod/light-graphql\n```\n\n### Key Components\n\n- **Schema Factory**: The schema is dynamically created using the `SchemaFactory` provided by the `Light\\GraphQL\\Server`. It allows adding namespaces for controllers.\n- **Controllers**: The `Controllers` namespace is used to define resolvers for GraphQL queries.\n\n- **GraphQL Execution**: The `Server::executeQuery` method is used to execute the GraphQL query against the schema. In the provided example, the query `$query` is executed, and the result is converted to an array using `toArray()`.\n\n### Usage Example\n\n\n```php\nuse Controllers\\RootController;\nuse GraphQL\\GraphQL;\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$server = new \\Light\\GraphQL\\Server();\n$server-\u003egetSchemaFactory()-\u003eaddNamespace(\"Controllers\");\n\nprint_R($sever-\u003eexecuteQuery($query)-\u003etoArray());\n```\n\n\n#### ServerRequestInterface handling\n\n```php\n\nuse Controllers\\RootController;\nuse GraphQL\\GraphQL;\n\n$server = new \\Light\\GraphQL\\Server();\n$server-\u003egetSchemaFactory()-\u003eaddNamespace(\"Controllers\");\n\n$response=$server-\u003ehandle($request);\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathsgod%2Flight-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathsgod%2Flight-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathsgod%2Flight-graphql/lists"}