{"id":23771633,"url":"https://github.com/michurin/playground-graphql-go","last_synced_at":"2025-09-05T15:32:39.906Z","repository":{"id":78009143,"uuid":"149439883","full_name":"michurin/playground-graphql-go","owner":"michurin","description":"[meeting-notes] Play with GraphQL and GoLang","archived":false,"fork":false,"pushed_at":"2019-11-06T12:08:17.000Z","size":27,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T09:06:14.266Z","etag":null,"topics":["dataloader","facebook-dataloader","golang","graphql","graphql-go"],"latest_commit_sha":null,"homepage":"","language":"Go","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/michurin.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":"2018-09-19T11:24:54.000Z","updated_at":"2020-10-20T06:31:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"b623a4cc-353c-4a19-b7fc-8e70c3f1b96e","html_url":"https://github.com/michurin/playground-graphql-go","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/michurin/playground-graphql-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michurin%2Fplayground-graphql-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michurin%2Fplayground-graphql-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michurin%2Fplayground-graphql-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michurin%2Fplayground-graphql-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michurin","download_url":"https://codeload.github.com/michurin/playground-graphql-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michurin%2Fplayground-graphql-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273777608,"owners_count":25166374,"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-09-05T02:00:09.113Z","response_time":402,"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":["dataloader","facebook-dataloader","golang","graphql","graphql-go"],"created_at":"2025-01-01T04:20:31.874Z","updated_at":"2025-09-05T15:32:39.896Z","avatar_url":"https://github.com/michurin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Playing with [GraphQL](http://graphql.org)\n\n- [Golang](http://golang.org)\n- [GraphQL](http://github.com/graphql-go/graphql)\n- [DataLoader](http://github.com/graph-gophers/dataloader)\n- [HTTP](http://github.com/graphql-go/handler)\n\n#### Install\n\n```sh\ngo get github.com/michurin/playground-graphql-go\n```\n\n#### Setup\n\n```sh\n$GOPATH/src/github.com/michurin/playground-graphql-go/database_init.sh\n```\n\nBy the way, you can easily view db using `database_show.sh`.\n\n#### Run\n\n```sh\n$GOPATH/bin/playground-graphql-go\n```\nor\n```sh\ngo run $GOPATH/src/github.com/michurin/playground-graphql-go/main.go\n```\n\n#### Enjoy\n\n```sh\nQ='query {x_customer(id: 200) {name rides {destination driver {rides {destination customer{name}}}}}}'\ncurl -XPOST http://localhost:8080/gql -H 'Content-Type: application/graphql' -d \"$Q\"\n```\n\n```javascript\n{\n    \"data\": {\n        \"x_customer\": {\n            \"name\": \"Customer_200\",\n            \"rides\": [\n                {\n                    \"destination\": \"Address_for_ride_2\",\n                    \"driver\": {\n                        \"rides\": [\n                            {\n                                \"customer\": {\n                                    \"name\": \"Customer_100\"\n                                },\n                                \"destination\": \"Adderss_for_ride_1\"\n                            },\n                            {\n                                \"customer\": {\n                                    \"name\": \"Customer_200\"\n                                },\n                                \"destination\": \"Address_for_ride_2\"\n                            }\n                        ]\n                    }\n                },\n                {\n                    \"destination\": \"Address_for_ride_3\",\n                    \"driver\": {\n                        \"rides\": [\n                            {\n                                \"customer\": {\n                                    \"name\": \"Customer_200\"\n                                },\n                                \"destination\": \"Address_for_ride_3\"\n                            }\n                        ]\n                    }\n                }\n            ]\n        }\n    }\n}\n```\n\n#### GraphQL schema\n\n```graphql\ntype Query {\n  x_customer(id: Int!): Customer\n  x_ride(id: Int!): Ride\n  x_rides(ids: [Int!]!): [Ride]\n}\n\ntype Customer {\n  deep_rides: [Ride!]!\n  id: Int!\n  name: String!\n  rides: [Ride!]!\n}\n\ntype Driver {\n  id: Int!\n  name: String!\n  rides: [Ride!]!\n}\n\ntype Ride {\n  customer: Customer!\n  destination: String!\n  driver: Driver!\n  id: Int!\n}\n\ninput RideInput {\n  customer_id: Int!\n  driver_id: Int!\n  destination: String!\n}\n\ntype Mutation {\n  add_ride(params: RideInput!): Ride\n}\n```\n\n#### Database schema\n\n```\n                Ride\nDriver          +-------------+\n+-----------+   | ride_id     |   Customer\n| driver_id |--\u003c| driver_id   |   +-------------+\n| name      |   | customer_id |\u003e--| customer_id |\n+-----------+   | destination |   | name        |\n                +-------------+   +-------------+\n```\n\nMore details in `database_init.sh` script.\n\n#### Related tools\n\n- [graphql-cli](https://github.com/graphql-cli/graphql-cli)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichurin%2Fplayground-graphql-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichurin%2Fplayground-graphql-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichurin%2Fplayground-graphql-go/lists"}