{"id":20109492,"url":"https://github.com/aniketsingh98571/mocky","last_synced_at":"2026-04-29T23:06:18.945Z","repository":{"id":217316297,"uuid":"742486754","full_name":"aniketsingh98571/Mocky","owner":"aniketsingh98571","description":"Mock Data Generator","archived":false,"fork":false,"pushed_at":"2024-03-15T15:14:41.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-02T18:28:16.576Z","etag":null,"topics":["api-mock","apollo-server","data-generator","developer-tools","graphql","mock-data-generator","mock-response-data","mock-responses","mockapi","nodejs","supabase"],"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/aniketsingh98571.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":"2024-01-12T15:33:30.000Z","updated_at":"2024-03-01T04:16:44.000Z","dependencies_parsed_at":"2024-01-15T18:24:31.907Z","dependency_job_id":"e6c7c0d8-9a36-43cf-944b-1d0943d32ab3","html_url":"https://github.com/aniketsingh98571/Mocky","commit_stats":null,"previous_names":["aniketsingh98571/mock-data-generator","aniketsingh98571/mocky"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aniketsingh98571/Mocky","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aniketsingh98571%2FMocky","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aniketsingh98571%2FMocky/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aniketsingh98571%2FMocky/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aniketsingh98571%2FMocky/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aniketsingh98571","download_url":"https://codeload.github.com/aniketsingh98571/Mocky/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aniketsingh98571%2FMocky/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265540184,"owners_count":23784889,"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":["api-mock","apollo-server","data-generator","developer-tools","graphql","mock-data-generator","mock-response-data","mock-responses","mockapi","nodejs","supabase"],"created_at":"2024-11-13T18:08:34.959Z","updated_at":"2026-04-29T23:06:18.757Z","avatar_url":"https://github.com/aniketsingh98571.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mock Data Generator 🚀\n\nGrab your next batch of mock user data for an exciting boost to your frontend projects! This project uses GraphQL, Apollo Server, and Node.js to generate and manage mock user data. \n\n## Tools Used 🛠️\n\n- **GraphQL**: A query language for APIs and a runtime for executing those queries with your existing data.\n- **Apollo Server**: An open-source, spec-compliant GraphQL server that's compatible with any GraphQL schema.\n- **Node.js**: A JavaScript runtime built on Chrome's V8 JavaScript engine.\n- **Supabase**: Supabase is an open source Firebase alternative.\n## Deployments 🔄\n\nDeployments are done on the cyclic platform to ensure continuous integration and delivery.\n\n## Actions 🎬\n\n1. **Get Single User**: Fetch details of a single user.\n2. **Get List of Users**: Fetch a list of all users.\n3. **Add User**: Add a new user to the database.\n4. **Update User**: Update details of an existing user.\n\n## Base URL 🌐\n\nThe base URL for the project is [https://ruby-precious-moth.cyclic.app](https://ruby-precious-moth.cyclic.app)\n\n## API Queries\n\n### 1. Get API Key\n\nTo get the API key, follow the steps shown below:\n\n```javascript\nconst query = `\n    query GetApiKey {\n        generateApiKey {\n            key\n        }\n    }\n`;\n\nfetch(BASE_URL, {\n    method: 'POST',\n    headers: { 'Content-Type': 'application/json' },\n    body: JSON.stringify({ query }),\n})\n.then(response =\u003e response.json())\n.then(data =\u003e console.log('data returned:', data));\n\n```\n\nThe API key is necessary for authentication and authorization purposes. It is used to track and control how the API is being used, to prevent abuse and ensure service quality.\n\nPlease note that the API key is sensitive information. Do not share it publicly or expose it in your client-side code. Always keep it secure.\n\n### 2. Get Users\n\nTo get the users list, follow the steps shown below:-\n\n```javascript\nconst query = `\n    query Users($range: Int!, $key: String!) {\n        users(range: $range, key: $key) {\n            name\n        }\n    }\n`;\n\nconst variables = {\n    range: 10, // replace with your actual range\n    key: 'API KEY' // replace with your actual key\n};\n\nfetch(BASE_URL, {\n    method: 'POST',\n    headers: { 'Content-Type': 'application/json' },\n    body: JSON.stringify({\n        query,\n        variables\n    }),\n})\n.then(response =\u003e response.json())\n.then(data =\u003e console.log('data returned:', data));\n```\n\n\n### 3. Get a User\n\nTo get a single user based on ID, follow the steps shown below:-\n\n```javascript\nconst query = `\n    query User($id: ID!, $key: String!) {\n        user(id: $id, key: $key) {\n            name\n        }\n    }\n`;\n\nconst variables = {\n    id: 1, // replace with your actual id,type-integer\n    key: 'API KEY' // replace with your actual key\n};\n\nfetch(BASE_URL, {\n    method: 'POST',\n    headers: { 'Content-Type': 'application/json' },\n    body: JSON.stringify({\n        query,\n        variables\n    }),\n})\n.then(response =\u003e response.json())\n.then(data =\u003e console.log('data returned:', data));\n```\n\n\n\n### 4. Add a User\n\nTo add a user, follow the steps shown below:-\n\n```javascript\nconst mutation = `\n    mutation Add($user: AddUserInput!, $key: String!) {\n        addUser(user: $user, key: $key) {\n            name\n        }\n    }\n`;\n\nconst variables = {\n    key: 'API KEY', // replace with your actual key\n    user: {\n        name: '\u003cANY NAME\u003e', // replace with your actual name\n        title: '\u003cANY TITLE\u003e', // replace with your actual title\n        socials: ['\u003cANY SOCIAL\u003e'], // replace with your actual socials\n        occupation: '\u003cANY OCCUPATION\u003e' // replace with your actual occupation\n    }\n};\n\nfetch(BASE_URL, {\n    method: 'POST',\n    headers: { 'Content-Type': 'application/json' },\n    body: JSON.stringify({\n        query: mutation,\n        variables\n    }),\n})\n.then(response =\u003e response.json())\n.then(data =\u003e console.log('data returned:', data));\n```\n\n\n### 5. Edit User\n\nTo edit a user details, follow the steps shown below:-\n\n```javascript\nconst mutation = `\n    mutation Edit($id: ID!, $user: EditUserInput!, $key: String!) {\n        updateUser(id: $id, user: $user, key: $key) {\n            name\n        }\n    }\n`;\n\nconst variables = {\n    id: 1, // replace with your actual id,type-integer\n    key: 'API KEY', // replace with your actual key\n    user: {\n        name: '\u003cANY NAME\u003e', // replace with your actual name\n        title: '\u003cANY TITLE\u003e', // replace with your actual title\n        socials: ['\u003cANY SOCIAL\u003e'], // replace with your actual socials\n        occupation: '\u003cANY OCCUPATION\u003e' // replace with your actual occupation\n    }\n};\n\nfetch(BASE_URL, {\n    method: 'POST',\n    headers: { 'Content-Type': 'application/json' },\n    body: JSON.stringify({\n        query: mutation,\n        variables\n    }),\n})\n.then(response =\u003e response.json())\n.then(data =\u003e console.log('data returned:', data));\n```\n\n\n## Contact 📞\n\nIf you have any questions, feel free to reach out!\n\n\n## Quick Notes\n1) GraphQL sits between a server and a client, you cannot have it as a layer between server and Database.\n2) In our case of Mocky, the apollo server is the GraphQL server(resolver), and from client we are accessing the data based on the defined schema of GraphQL.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faniketsingh98571%2Fmocky","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faniketsingh98571%2Fmocky","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faniketsingh98571%2Fmocky/lists"}