{"id":20837984,"url":"https://github.com/mabc224/node-apollo-graphql-jwt-api","last_synced_at":"2026-04-12T03:03:56.859Z","repository":{"id":94935192,"uuid":"204175389","full_name":"mabc224/node-apollo-graphql-jwt-api","owner":"mabc224","description":"Node Express based Apollo GraphQL api with custom directive, authentication and authorization with jwt","archived":false,"fork":false,"pushed_at":"2020-07-18T04:06:34.000Z","size":13,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-31T19:29:02.629Z","etag":null,"topics":["apollo","apollo-server-express","directives","expressjs","graphql","jwt","jwt-authentication","nodejs"],"latest_commit_sha":null,"homepage":"https://tt0fh.sse.codesandbox.io/graphql","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/mabc224.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":"2019-08-24T15:23:51.000Z","updated_at":"2023-09-19T10:19:54.000Z","dependencies_parsed_at":"2023-04-26T13:32:41.739Z","dependency_job_id":null,"html_url":"https://github.com/mabc224/node-apollo-graphql-jwt-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mabc224/node-apollo-graphql-jwt-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mabc224%2Fnode-apollo-graphql-jwt-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mabc224%2Fnode-apollo-graphql-jwt-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mabc224%2Fnode-apollo-graphql-jwt-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mabc224%2Fnode-apollo-graphql-jwt-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mabc224","download_url":"https://codeload.github.com/mabc224/node-apollo-graphql-jwt-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mabc224%2Fnode-apollo-graphql-jwt-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31702582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T21:17:31.016Z","status":"online","status_checked_at":"2026-04-12T02:00:06.763Z","response_time":58,"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":["apollo","apollo-server-express","directives","expressjs","graphql","jwt","jwt-authentication","nodejs"],"created_at":"2024-11-18T01:09:02.246Z","updated_at":"2026-04-12T03:03:56.853Z","avatar_url":"https://github.com/mabc224.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## APP: [https://tt0fh.sse.codesandbox.io/graphql](https://tt0fh.sse.codesandbox.io/graphql)  \n\n### CodeSandbox: [https://codesandbox.io/s/node-express-apollo-graphql-jwt-api-tt0fh](https://codesandbox.io/s/node-express-apollo-graphql-jwt-api-tt0fh)\n\nSetup:\n\n```$xslt\nnpm install\nnpm start\nhttp://localhost:8000/graphql\n\nRunning in dev mode\nnpm run dev\n```\n\n\nThis code base is for understanding of HTTP, GraphQL, Node.js and general API practices.\n\nInstructions:\n\n1. Implement a Node.js-based server with raw `http`, Koa or Express.\n2. Add a `/graphql` endpoint serving the apollo-server or any other GraphQL implementation.\n3. Schema must be able to return proper response for the following public query:\n\n```graphql\n{\n  movies {\n    title\n    year\n    rating\n    actors {\n      name\n      birthday\n      country\n      directors {\n        name\n        birthday\n        country\n      }\n    }\n  }\n}\n```\n\n4. Add support for the following mutation:\n```graphql\nmutation createUser($username: String, $password: String) {\n  createUser(username: $username, password: $password) {\n    token\n    user {\n      id\n      name\n    }\n  }\n}\n\nInput Fields\n{\n  \"username\": \"\",\n  \"password\": \"\"\n}\n\n```\n\n5. To expand on the number four, add a mutation-based authentication that accepts:\n```graphql\nmutation login($username: String, $password: String) {\n  login(username: $username, password: $password) {\n    token\n    user {\n      id\n      name\n    }\n  }\n}\n\nInput Fields\n{\n  \"username\": \"\",\n  \"password\": \"\"\n}\n\n\nHTTP Headers\n{\n    \"Authorization\": \"Bearer ...Token...\"\n}\n```\n\n\n6. Authenticated users may request additional fields for the query used earlier. New `scoutbase_rating` field must return the a random string between 5.0-9.0:\n\n```graphql\n{\n  movies {\n    scoutbase_rating\n\n    title\n    year\n    rating\n    actors {\n      name\n      birthday\n      country\n      directors {\n        name\n        birthday\n        country\n      }\n    }\n  }\n}\n\nHTTP Headers\n{\n    \"Authorization\": \"Bearer ...Token...\"\n}\n```\n\n7. `/graphql` must be accessible for external clients.\n\n8. End.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmabc224%2Fnode-apollo-graphql-jwt-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmabc224%2Fnode-apollo-graphql-jwt-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmabc224%2Fnode-apollo-graphql-jwt-api/lists"}