{"id":16296857,"url":"https://github.com/windomz/graphql-examples","last_synced_at":"2025-10-12T12:08:20.521Z","repository":{"id":61623862,"uuid":"97488961","full_name":"WindomZ/graphql-examples","owner":"WindomZ","description":":clipboard: Unified GraphQL examples written in Go, Node.js, PHP.","archived":false,"fork":false,"pushed_at":"2020-05-08T12:29:21.000Z","size":1425,"stargazers_count":4,"open_issues_count":5,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T23:12:07.284Z","etag":null,"topics":["example-project","go","graphql","graphql-example","learn-graphql","multi-language","nodejs","php"],"latest_commit_sha":null,"homepage":"","language":"Go","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/WindomZ.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}},"created_at":"2017-07-17T14:59:51.000Z","updated_at":"2022-08-27T14:32:28.000Z","dependencies_parsed_at":"2022-10-18T18:00:21.947Z","dependency_job_id":null,"html_url":"https://github.com/WindomZ/graphql-examples","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/WindomZ%2Fgraphql-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WindomZ%2Fgraphql-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WindomZ%2Fgraphql-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WindomZ%2Fgraphql-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WindomZ","download_url":"https://codeload.github.com/WindomZ/graphql-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244052243,"owners_count":20390066,"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":["example-project","go","graphql","graphql-example","learn-graphql","multi-language","nodejs","php"],"created_at":"2024-10-10T20:24:12.136Z","updated_at":"2025-10-12T12:08:15.472Z","avatar_url":"https://github.com/WindomZ.png","language":"Go","readme":"# graphql-examples\n\n\u003e Unified GraphQL examples written in Go, Node.js, PHP.\n\n[![Build Status](https://travis-ci.org/WindomZ/graphql-examples.svg?branch=master)](https://travis-ci.org/WindomZ/graphql-examples)\n[![Go Report Card](https://goreportcard.com/badge/github.com/WindomZ/graphql-examples)](https://goreportcard.com/report/github.com/WindomZ/graphql-examples)\n[![Greenkeeper badge](https://badges.greenkeeper.io/WindomZ/graphql-examples.svg)](https://greenkeeper.io/)\n[![Dependency](https://david-dm.org/WindomZ/url-generator.svg)](https://david-dm.org/WindomZ/url-generator)\n[![styled with prettier](https://img.shields.io/badge/js_styled_with-prettier-brightgreen.svg)](https://github.com/prettier/prettier)\n[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)\n\n## Purpose\n\n- **Unified** GraphQL example template.\n- **Multiple** languages: Go, Node.js, PHP.\n- **Easy** to learn primary GraphQL.\n- **Test** compatibility.\n- **HTTP** services.\n\n## Install\n\n### Go\n```bash\ngo get github.com/WindomZ/graphql-examples/...\n```\n\n### Node.js\n```bash\nnpm install\n# or\nyarn\n```\n\n### PHP\n```bash\ncomposer install\n```\n\n## Usage\n\n### Single\n\nEach under the `go`, `nodejs`, `php` directory paths.\n\n### Integrated\n\nIf you have `Go(go get)`, `PHP(composer)`, `Node.js(npm/yarn)` installed.\n\nYou can run and select service:\n```\n./run.sh\n```\nRun the test with all above languages:\n```\n./test.sh\n```\n\n## Template\n\nDefine a schema that is the basis for all queries: \n```\n// add a User type\ntype User {\n  id: String!\n  name: String\n}\n\n// define a schema\ntype Query {\n  hello(message: String): String\n  bye: String\n  user(id: String!): User\n}\ntype Mutation {\n  sum(x: Int, y: Int): Int\n}\n```\n\nThe example queries on the above schema would be:\n\nQuery `hello`: \n```\nquery Query {\n  hello(message: \"world\")\n}\n```\n\nQuery `bye`: \n```\n// test root values\nquery Query {\n  bye\n}\n```\n\nQuery `user`: \n```\n// test numbers and some symbols\nquery Query {\n  user(id:\"1\") {\n    name\n  }\n}\n// test English\nquery Query {\n  user(id:\"id\") {\n    name\n  }\n}\n// test Chinese\nquery Query {\n  user(id:\"编号\") {\n    name\n  }\n}\n```\n\nQuery `sum`: \n```\nmutation Calc {\n  sum(x: 1, y: 2)\n}\n```\n\n## Related\n\n- [graphql](https://github.com/facebook/graphql) Official documents\n- [graphql-js](https://github.com/graphql/graphql-js) + [express-graphql](https://github.com/graphql/express-graphql)\n- [graphql-go](https://github.com/graphql-go/graphql)\n- [graphql-php](https://github.com/webonyx/graphql-php)\n\n## Contributing\n\nWelcome to pull requests, report bugs, suggest ideas and discuss \n**graphql-examples** on [issues page](https://github.com/WindomZ/graphql-examples/issues).\n\nIf you like it then you can put a :star: on it.\n\n## Roadmap\n\n- [x] Support Golang.\n- [x] Support Node.js.\n- [x] Support PHP.\n- [ ] Support Java.\n- [x] Hello \u0026 Bye example template.\n- [x] Calc(sum) example template.\n- [x] User example template.\n- [ ] Star Wars example template.\n- [x] HTTP services.\n- [ ] HTTPS services.\n- [ ] RPC services.\n\n## License\n\n[MIT](https://github.com/WindomZ/graphql-examples/blob/master/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindomz%2Fgraphql-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwindomz%2Fgraphql-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindomz%2Fgraphql-examples/lists"}