{"id":13621475,"url":"https://github.com/vit0rr/users-graphiql","last_synced_at":"2025-04-22T22:19:57.037Z","repository":{"id":38236447,"uuid":"494558369","full_name":"vit0rr/users-graphiql","owner":"vit0rr","description":"Crud with GraphQL + Express + Json Server","archived":false,"fork":false,"pushed_at":"2022-06-08T16:45:36.000Z","size":235,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-29T19:22:27.395Z","etag":null,"topics":["express","graphql","json-server","nodejs"],"latest_commit_sha":null,"homepage":"","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/vit0rr.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}},"created_at":"2022-05-20T17:48:31.000Z","updated_at":"2024-02-07T14:27:34.000Z","dependencies_parsed_at":"2022-09-07T03:01:03.844Z","dependency_job_id":null,"html_url":"https://github.com/vit0rr/users-graphiql","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/vit0rr%2Fusers-graphiql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vit0rr%2Fusers-graphiql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vit0rr%2Fusers-graphiql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vit0rr%2Fusers-graphiql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vit0rr","download_url":"https://codeload.github.com/vit0rr/users-graphiql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250331941,"owners_count":21413127,"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":["express","graphql","json-server","nodejs"],"created_at":"2024-08-01T21:01:06.856Z","updated_at":"2025-04-22T22:19:57.001Z","avatar_url":"https://github.com/vit0rr.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# How to run the project\n\n```bash\n### Install dependecies\n$ yarn install\n\n### Run GraphQL server\n$ yarn dev\n\n### Run Json Server\n$ yarn run json:server\n\n### The server will start at port http://localhost:4000/graphql \n### The Json Server will start at port http://localhost:3000/users/\n```\n\n# How the project work?\n\nIn my `server.js` I have my express code that can start my server and listen on localhost:4000/graphql a GraphQL server that listen my schema and a rule that set my property graphiql to `true`.\n\n`schema.js` has the GraphQL schema, with my types, Queryes and mutations.\n\n# How to run the CRUD?\n\nWith the both server started, I made two principles fetches: `user` and `company`.\n\nThe user fetch:\n```GraphQL\n\n# Will return informations about user with id \"41\"\n\n{\n  user(id: \"41\") {\n    id\n    firstName\n    age\n    company {\n      name\n    }\n  }\n}\n```\n\nThe company fetch:\n```GraphQL\n# Will return informations about the company by id and who users work in this company\n\n{\n  company(id: \"2\"){\n    id\t\n    name\n    description\n    users{\n      firstName\n    }\n  }\n}\n\n```\n\nAdd users:\n```GraphQL\n\nmutation{\n  addUser(firstName: \"Elon\" age: 32){\n    firstName\n    age\n  }\n}\n\n```\n\nDelete users:\n```GraphQL\n\nmutation{\n  deleteUser(id: \"4pQ-ym-\"){\n    id\n  }\n}\n\n```\n\nEdit users:\n\n```GraphQL\n\nmutation {\n  editUser(id: \"uX1tabO\", firstName: \"Markinhos\", age: 100, companyId: \"2\") {\n    id\n    firstName\n    age\n    company{\n      id\n      name\n      description\n    }\n  }\n}\n\n\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvit0rr%2Fusers-graphiql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvit0rr%2Fusers-graphiql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvit0rr%2Fusers-graphiql/lists"}