{"id":16995719,"url":"https://github.com/olivierjm/graphql-auth-demo","last_synced_at":"2026-03-10T04:03:41.534Z","repository":{"id":40625731,"uuid":"188787616","full_name":"OlivierJM/graphql-auth-demo","owner":"OlivierJM","description":"demo on how to handle authentication in GraphQL","archived":false,"fork":false,"pushed_at":"2023-02-03T02:30:03.000Z","size":374,"stargazers_count":2,"open_issues_count":6,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T16:52:56.779Z","etag":null,"topics":["apollo-server","authentication","codesandbox","graphql","graphql-server","server"],"latest_commit_sha":null,"homepage":"https://n6bpe.sse.codesandbox.io/","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/OlivierJM.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}},"created_at":"2019-05-27T06:52:16.000Z","updated_at":"2023-03-04T04:31:47.000Z","dependencies_parsed_at":"2023-01-30T07:31:22.206Z","dependency_job_id":null,"html_url":"https://github.com/OlivierJM/graphql-auth-demo","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/OlivierJM%2Fgraphql-auth-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlivierJM%2Fgraphql-auth-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlivierJM%2Fgraphql-auth-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlivierJM%2Fgraphql-auth-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OlivierJM","download_url":"https://codeload.github.com/OlivierJM/graphql-auth-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525162,"owners_count":21118617,"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":["apollo-server","authentication","codesandbox","graphql","graphql-server","server"],"created_at":"2024-10-14T03:49:39.746Z","updated_at":"2026-03-10T04:03:36.506Z","avatar_url":"https://github.com/OlivierJM.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# graphql-auth-demo\n\nCreated with CodeSandbox, the article that properly explains this is [here](https://medium.com/developer-circles-lusaka/https-medium-com-olivierjm-auth-graphql-7f92e8120027) \n\n\u003e This was created to demonstrate authentication in GraphQL.\n\n- create a user\n- authenticate the user\n- generate and validate the token\n\n\n**Used**\n\n- apollo-server v2\n- jsonwebtoken\n- bcrypt\n- pick(from lodash)\n- mongoose\n\nAlthought this example uses mongoose and MongoDb, you can easily set up any other database.\n\n**Mutations**\n\n```graphql\nmutation {\n  register(email:\"olivier@gmail.com\", password:\"compl8353pass\"){\n    email\n    password\n  }\n}\n```\n\n```graphql\nmutation {\n  login(email:\"olivier@gmail.com\", password:\"compl8353pass\")\n}\n```\n\n**Queries**\n\n```graphql\n{\n  users {\n    email\n    password\n  }\n  loggedInUser {\n    email\n  }\n}\n\n```\n\n\n**To-do**\n\n- Use a different database (relational)\n- Migrate to typescript\n- Add more examples to show how relationships work in GraphQL\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folivierjm%2Fgraphql-auth-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folivierjm%2Fgraphql-auth-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folivierjm%2Fgraphql-auth-demo/lists"}