{"id":14258673,"url":"https://github.com/tylerthebuildor/graphqless","last_synced_at":"2025-08-13T01:31:35.146Z","repository":{"id":69915647,"uuid":"165203985","full_name":"tylerthebuildor/graphqless","owner":"tylerthebuildor","description":" REST and GraphQL really aren't that different. I'll prove it!","archived":false,"fork":false,"pushed_at":"2019-12-04T04:28:35.000Z","size":519,"stargazers_count":287,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-07T09:44:33.087Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/tylerthebuildor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2019-01-11T08:04:11.000Z","updated_at":"2025-07-08T01:23:51.000Z","dependencies_parsed_at":"2023-02-27T14:16:27.670Z","dependency_job_id":null,"html_url":"https://github.com/tylerthebuildor/graphqless","commit_stats":null,"previous_names":["tylerthebuildor/graphqless"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/tylerthebuildor/graphqless","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylerthebuildor%2Fgraphqless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylerthebuildor%2Fgraphqless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylerthebuildor%2Fgraphqless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylerthebuildor%2Fgraphqless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tylerthebuildor","download_url":"https://codeload.github.com/tylerthebuildor/graphqless/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylerthebuildor%2Fgraphqless/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269865485,"owners_count":24487604,"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-11T02:00:10.019Z","response_time":75,"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":[],"created_at":"2024-08-22T09:01:22.597Z","updated_at":"2025-08-13T01:31:34.765Z","avatar_url":"https://github.com/tylerthebuildor.png","language":"JavaScript","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"GraphQLess\" src=\"examples/logo.png\" width=\"60\" /\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003e\n  GraphQLess\n\u003c/h1\u003e\n\u003ch3 align=\"center\"\u003e\n  ⚛️ 🚀🤘\n\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eREST and GraphQL really aren't that different. I'll prove it!\u003c/strong\u003e\u003cbr\u003e\n  GraphQLess is a thin wrapper around the official \u003ca href=\"https://github.com/apollographql/apollo-server/tree/master/packages/apollo-server-express\"\u003eapollo-server-express\u003c/a\u003e project.\n  \u003cbr /\u003e\n  GraphQLess lets you write a GraphQL server in an Express.js style.\n\u003c/p\u003e\n\n## Setup\n\n```bash\nyarn add graphqless\n```\n\nAnd here is how you write a server... Look familiar?\n\n```jsx\nconst { GraphQLess } = require('graphqless');\nconst app = new GraphQLess();\n\nconst db = { users: [{ name: 'Tyler' }] };\n\napp.get('/users', (req, res) =\u003e {\n  const { users } = db;\n  res.send(users);\n});\n\napp.get('/user', (req, res) =\u003e {\n  const user = db.users.find(user =\u003e user.name === req.body.name);\n  res.send(user);\n});\n\napp.post('/createUser', (req, res) =\u003e {\n  const userCount = db.users.push({ name: req.body.name });\n  res.send(userCount);\n});\n\napp.listen(3000, () =\u003e {\n  console.log('Visit: http://localhost:3000/playground');\n});\n```\n\nI know it looks like Express.js but the code above is a GraphQL server! There is one caveat though...\n\nGraphQL requires us to write a schema that describes the `.get` and `.post` functions' inputs and outputs.\n\nJust know that `.get === Query \u0026\u0026 .post === Mutation`. Now let's modify the last few lines of the snippet above to include the required schema:\n\n```jsx\napp\n  .useSchema(\n    `\n    type Query {\n      users: [User]\n      user(name: String): User\n    }\n    type Mutation {\n      createUser(name: String): Int\n    }\n    type User {\n      name: String\n    }\n  `\n  )\n  .listen(3000, () =\u003e {\n    console.log('Visit: http://localhost:3000/playground');\n  });\n```\n\nThat's the only catch! You now have a fully functioning and extendable GraphQL server.\n\nYou can find more examples in the [examples](/examples) folder.\n\n## Examples\n\n### Queries for examples/example\n\n```bash\nnpx nodemon examples/example.js\n```\n\n```graphql\nmutation createUser {\n  createUser(name: \"Buchea\")\n}\n\nquery getUsers {\n  users {\n    name\n  }\n  user(name: \"Tyler\") {\n    name\n  }\n}\n```\n\n### Queries for examples/exampleWithAuth\n\n```bash\nnpx nodemon examples/exampleWithAuth.js\n```\n\n```graphql\n# Add this to \"HTTP HEADERS\" in GraphQL Playground:\n# { \"Authorization\": \"Bearer eyJhbGciOiJIUzI1NiJ9.YWJj.4noRC-c0ay0hOeZ5Cgc80MVS0P4p4FrR2lJFzMNSnE4\" }\n\nquery getMe {\n  getToken\n  me {\n    id\n    name\n  }\n}\n```\n\n### Queries for examples/exampleWithRouter\n\n```bash\nnpx nodemon examples/exampleWithRouter/index.js\n```\n\n```graphql\nmutation createUser {\n  createUser(name: \"Buchea\")\n}\n\nquery getUsers {\n  users {\n    name\n  }\n  user(name: \"Tyler\") {\n    name\n  }\n}\n```\n\n### Queries for examples/exampleWithReactClient\n\n```bash\nnpx nodemon examples/exampleWithReactClient/index.js\n```\n\n```graphql\nmutation createUser {\n  createUser(name: \"Buchea\") {\n    name\n  }\n}\n\nquery getUsers {\n  users {\n    name\n  }\n}\n```\n\n### Queries for examples/exampleWithSubscription\n\n```bash\nnpx nodemon examples/exampleWithSubscription.js\n```\n\n```graphql\nsubscription subscribeToCount {\n  count\n}\n\nquery getDummyData {\n  dummy\n}\n```\n\n### Queries for examples/exampleWithRelations\n\n```bash\nnpx nodemon examples/exampleWithRelations.js\n```\n\n```graphql\nquery getDeepRelations {\n  users {\n    name\n    favorites {\n      name\n      user {\n        name\n      }\n    }\n  }\n}\n```\n","funding_links":[],"categories":["📦 Legacy \u0026 Inactive Projects","JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylerthebuildor%2Fgraphqless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftylerthebuildor%2Fgraphqless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylerthebuildor%2Fgraphqless/lists"}