{"id":19423486,"url":"https://github.com/4rthem/graphql-mapper-demo","last_synced_at":"2026-05-12T21:36:31.074Z","repository":{"id":98952230,"uuid":"59324088","full_name":"4rthem/graphql-mapper-demo","owner":"4rthem","description":"A GraphQL Mapper demo","archived":false,"fork":false,"pushed_at":"2016-05-20T22:02:17.000Z","size":8,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-07T18:55:09.226Z","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/4rthem.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-20T20:23:58.000Z","updated_at":"2017-09-04T10:45:55.000Z","dependencies_parsed_at":"2023-05-02T22:30:41.867Z","dependency_job_id":null,"html_url":"https://github.com/4rthem/graphql-mapper-demo","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/4rthem%2Fgraphql-mapper-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4rthem%2Fgraphql-mapper-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4rthem%2Fgraphql-mapper-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4rthem%2Fgraphql-mapper-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4rthem","download_url":"https://codeload.github.com/4rthem/graphql-mapper-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240603521,"owners_count":19827713,"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-10T13:39:10.951Z","updated_at":"2026-05-12T21:36:30.998Z","avatar_url":"https://github.com/4rthem.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphQL Mapper demo\n\nA demo for the [GraphQL Mapper](https://github.com/4rthem/graphql-mapper) library\n\n## Installation\n\nInstall composer dependencies:\n\n```bash\ncomposer install\n```\n\nCreate your database:\n\n```sql\nCREATE DATABASE `graphql-demo`;\n```\n\nGenerate the schema:\n\n```bash\nbin/doctrine orm:schema-tool:create\n```\n\nRun the following SQL query in order to get fixtures:\n\n```sql\nINSERT INTO `sw_characters` (`id`, `name`, `appearsIn`, `discr`, `homePlanet`, `primaryFunction`) VALUES\n(1000, 'Luke Skywalker', '[4,5,6]', 'human', 'Tatooine', NULL),\n(1001, 'Darth Vader', '[4,5,6]', 'human', 'Tatooine', NULL),\n(1002, 'Han Solo', '[4,5,6]', 'human', NULL, NULL),\n(1003, 'Leia Organa', '[4,5,6]', 'human', 'Alderaan', NULL),\n(1004, 'Wilhuff Tarkin', '[4]', 'human', NULL, NULL),\n(2000, 'C-3PO', '[4,5,6]', 'droid', NULL, 'Protocol'),\n(2001, 'R2-D2', '[4,5,6]', 'droid', NULL, 'Astromech'),\n(2002, 'test-droid', '[5,4]', 'droid', NULL, 'tester');\n\nINSERT INTO `friend` (`character_source`, `character_target`) VALUES\n(1000, 1002),\n(1000, 1003),\n(1000, 2000),\n(1000, 2001),\n(1001, 1004),\n(1002, 1000),\n(1002, 1003),\n(1002, 2001),\n(1003, 1000),\n(1003, 1002),\n(1003, 2000),\n(1003, 2001),\n(1004, 1001),\n(2000, 1000),\n(2000, 1002),\n(2000, 1003),\n(2000, 2001),\n(2001, 1000),\n(2001, 1002),\n(2001, 1003);\n```\n\n## Usage\n\nRun the local server:\n\n```bash\nphp -S localhost:8000\n```\n\nthen you can query your schema at `POST http://localhost:8000/entry.php`\n\n### Example\n\nFor the given cURL request:\n\n```bash\ncurl -XPOST 'http://localhost:8000/entry.php' -d 'query=query FooBar {\n    luke: hero(episode: EMPIRE) {\n        id,\n        name,\n        friends {\n            id, name\n        }\n    },\n    droid(id: \"2001\") {\n        primaryFunction\n    }\n}'\n```\n\nyou should receive the following response:\n\n```json\n{\n    \"data\": {\n        \"luke\": {\n            \"id\":1000,\n            \"name\":\"Luke Skywalker\",\n            \"friends\": [\n                {\n                    \"id\":1002,\n                    \"name\":\"Han Solo\"\n                },\n                {\n                    \"id\":1003,\n                    \"name\":\"Leia Organa\"\n                },\n                {\n                    \"id\":2000,\n                    \"name\":\"C-3PO\"\n                },\n                {\n                    \"id\":2001,\n                    \"name\":\"R2-D2\"\n                }\n            ]\n        },\n        \"droid\":{\n            \"primaryFunction\":\"Astromech\"\n        }\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4rthem%2Fgraphql-mapper-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4rthem%2Fgraphql-mapper-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4rthem%2Fgraphql-mapper-demo/lists"}