{"id":26915168,"url":"https://github.com/graphqlguide/all-the-databases","last_synced_at":"2025-08-27T04:08:42.054Z","repository":{"id":97179845,"uuid":"77756704","full_name":"GraphQLGuide/all-the-databases","owner":"GraphQLGuide","description":"A GraphQL server tutorial combining 5 data sources","archived":false,"fork":false,"pushed_at":"2017-05-17T06:37:33.000Z","size":23,"stargazers_count":75,"open_issues_count":0,"forks_count":20,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-17T21:51:58.076Z","etag":null,"topics":["elasticsearch","graphql","graphql-server","mongodb","postgresql","redis","tutorial"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/GraphQLGuide.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":"2016-12-31T21:34:17.000Z","updated_at":"2025-07-17T16:49:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"8b0ee390-067d-4e87-8324-0fe7bc8c47b7","html_url":"https://github.com/GraphQLGuide/all-the-databases","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GraphQLGuide/all-the-databases","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GraphQLGuide%2Fall-the-databases","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GraphQLGuide%2Fall-the-databases/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GraphQLGuide%2Fall-the-databases/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GraphQLGuide%2Fall-the-databases/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GraphQLGuide","download_url":"https://codeload.github.com/GraphQLGuide/all-the-databases/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GraphQLGuide%2Fall-the-databases/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272289247,"owners_count":24907796,"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-08-27T02:00:09.397Z","response_time":76,"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":["elasticsearch","graphql","graphql-server","mongodb","postgresql","redis","tutorial"],"created_at":"2025-04-01T17:51:45.863Z","updated_at":"2025-08-27T04:08:42.045Z","avatar_url":"https://github.com/GraphQLGuide.png","language":"JavaScript","readme":"# All the Databases\n\nA GraphQL server tutorial combining 5 data sources:\n\nhttps://www.compose.com/articles/use-all-the-databases-part-1/\n\nTo follow along, check out the [`empty-resolvers` branch](https://github.com/GraphQLGuide/all-the-databases/tree/empty-resolvers).\n\nCode written in the tutorial can be found in:\n\n- [server.js](https://github.com/GraphQLGuide/all-the-databases/blob/master/server.js)\n- [data/schema.js](https://github.com/GraphQLGuide/all-the-databases/blob/master/data/schema.js)\n- [data/resolvers.js](https://github.com/GraphQLGuide/all-the-databases/blob/master/data/resolvers.js)\n\nThere's also database, ORM, and seeding code in [data/connectors.js](https://github.com/GraphQLGuide/all-the-databases/blob/master/data/connectors.js).\n\n## Browse data\n\nHere's the deployed version of this server:\n\n[all-the-databases.graphql.guide/graphiql](https://all-the-databases.graphql.guide/graphiql)\n\nNow [try out a query](#query)\n\n## Run locally\n\nGet the code:\n\n```sh\ngit clone git@github.com:GraphQLGuide/all-the-databases.git\ncd all-the-databases\nnpm install\n```\n\nGet the databases:\n\n```\nbrew install redis\nbrew install elasticsearch\nbrew install mongodb\n```\n\nRun one command per terminal tab:\n\n```\nmongod\n```\n\n```\nredis-server /usr/local/etc/redis.conf\n```\n\n```\nelasticsearch\n```\n\nThen in the `all-the-databases/` directory, run the GraphQL server:\n\n```\nnpm run dev\n```\n\nThen open:\n\n[localhost:8080/graphiql](http://localhost:8080/graphiql)\n\nThen query:\n\n## Query\n\n![GraphiQL screenshot](https://www.dropbox.com/s/gteo8r98tztgz7n/Screenshot%202017-01-04%2018.13.59.png?raw=1)\n\nWhen you paste this on the left side of the GraphiQL page:\n\n```\n{\n  user(id: 1) {\n    firstName\n    lastName\n    photo\n    mentions {\n      ...TweetDetails\n    }\n  }      \n  publicFeed {\n    ...TweetDetails\n  }\n  cityFeed {\n    ...TweetDetails\n  }\n}\n\nfragment TweetDetails on Tweet {\n  text\n  author {\n    firstName\n    lastName\n    photo\n  }      \n  city\n  views\n  created\n}\n```\n\nand hit the play button (or `cmd-return`), then you should get something like this on the right:\n\n```json\n{\n  \"data\": {\n    \"user\": {\n      \"firstName\": \"Maurine\",\n      \"lastName\": \"Rau\",\n      \"photo\": \"http://placekitten.com/200/139\",\n      \"mentions\": [\n        {\n          \"text\": \"Maurine Rau Eligendi in deserunt.\",\n          \"author\": {\n            \"firstName\": \"Maurine\",\n            \"lastName\": \"Rau\",\n            \"photo\": \"http://placekitten.com/200/139\"\n          },\n          \"city\": \"San Francisco\",\n          \"views\": 82,\n          \"created\": 1481757217713\n        }\n      ]\n    },\n    \"publicFeed\": [\n      {\n        \"text\": \"Corporis qui impedit cupiditate rerum magnam nisi velit aliquam.\",\n        \"author\": {\n          \"firstName\": \"Tia\",\n          \"lastName\": \"Berge\",\n          \"photo\": \"http://placekitten.com/200/139\"\n        },\n        \"city\": \"New York\",\n        \"views\": 91,\n        \"created\": 1481757215183\n      },\n      {\n        \"text\": \"Aut numquam aut dolorem.\",\n        \"author\": {\n          \"firstName\": \"Soledad\",\n          \"lastName\": \"White\",\n          \"photo\": \"http://placekitten.com/200/139\"\n        },\n        \"city\": \"New York\",\n        \"views\": 69,\n        \"created\": 1481757216183\n      },\n      {\n        \"text\": \"Consequatur voluptates eaque voluptatem neque assumenda omnis.\",\n        \"author\": {\n          \"firstName\": \"Arlo\",\n          \"lastName\": \"Kertzmann\",\n          \"photo\": \"http://placekitten.com/200/139\"\n        },\n        \"city\": \"New York\",\n        \"views\": 51,\n        \"created\": 1481757217182\n      }\n    ],\n    \"cityFeed\": [\n      {\n        \"text\": \"Edmond Jones Harum ullam pariatur quos est quod.\",\n        \"author\": {\n          \"firstName\": \"Edmond\",\n          \"lastName\": \"Jones\",\n          \"photo\": \"http://placekitten.com/200/139\"\n        },\n        \"city\": \"Mountain View\",\n        \"views\": 69,\n        \"created\": 1481757216723\n      },\n      {\n        \"text\": \"Katlyn Reichert Quos sequi molestiae beatae.\",\n        \"author\": {\n          \"firstName\": \"Katlyn\",\n          \"lastName\": \"Reichert\",\n          \"photo\": \"http://placekitten.com/200/139\"\n        },\n        \"city\": \"Mountain View\",\n        \"views\": 55,\n        \"created\": 1481757214738\n      },\n      {\n        \"text\": \"Jayde Conn Occaecati rerum neque et.\",\n        \"author\": {\n          \"firstName\": \"Jayde\",\n          \"lastName\": \"Conn\",\n          \"photo\": \"http://placekitten.com/200/139\"\n        },\n        \"city\": \"Mountain View\",\n        \"views\": 85,\n        \"created\": 1481757209779\n      }\n    ]\n  }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphqlguide%2Fall-the-databases","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphqlguide%2Fall-the-databases","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphqlguide%2Fall-the-databases/lists"}