{"id":19433169,"url":"https://github.com/pariazar/graphql-boilerplates","last_synced_at":"2026-03-02T03:04:34.575Z","repository":{"id":112490601,"uuid":"445806292","full_name":"pariazar/graphql-boilerplates","owner":"pariazar","description":null,"archived":false,"fork":false,"pushed_at":"2022-01-05T12:50:07.000Z","size":134,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-19T03:02:43.072Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"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/pariazar.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":"2022-01-08T11:56:14.000Z","updated_at":"2022-01-10T06:27:20.000Z","dependencies_parsed_at":"2023-05-15T08:00:32.574Z","dependency_job_id":null,"html_url":"https://github.com/pariazar/graphql-boilerplates","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pariazar/graphql-boilerplates","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pariazar%2Fgraphql-boilerplates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pariazar%2Fgraphql-boilerplates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pariazar%2Fgraphql-boilerplates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pariazar%2Fgraphql-boilerplates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pariazar","download_url":"https://codeload.github.com/pariazar/graphql-boilerplates/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pariazar%2Fgraphql-boilerplates/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29991299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"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-11-10T14:38:41.083Z","updated_at":"2026-03-02T03:04:34.560Z","avatar_url":"https://github.com/pariazar.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"typescript prisma graphql type-graphql apollo-server-express postgresql\n\n**!note:** Note that I am a junior and would be grateful if you could fix any bugs and add any additional features ❤️.\n\n# How to run\n\n  \n\n1. Run `npm i`.\n\n2. Fill `.env.sample` with your configuration and save it as `.env`\n\n3. Run `npx prisma migrate dev --name init`.\n\n4. Run `npm run dev`.\n\n  \n\n# Schema\n\nYou can create your schema in `prisma/schema.prisma`, we have a User entity to show you how to define everything!\n\nThere is a generator for Graphql to generate models automatically from prisma schema.\n\n``` graphql\n\ngenerator  typegraphql {\n\tprovider  =  \"typegraphql-prisma\"\n}\n\n```\n\n`output` is optional and should be used with `emitTranspiledCode`. if you don't define output, default generated folder will be created in `node_modules`.\n\n``` graphql\n\ngenerator  typegraphql {\n\tprovider  =  \"typegraphql-prisma\"\n\toutput  =  \"./generated/\"\n\temitTranspiledCode  =  true\n}\n\n```\n\n  \n\nAfter `npx prisma migrate dev --name init` or `npx prisma generate` you have a beautiful crud with all relations and types.\n\n  \n\n**!note:** after each time you change `schema.prisma`, you have to run `npx prisma migrate dev --name anything` that 'anything' is any name you want to control each change on database.\n\n  \n\nTo read more about prisma and type-graphql, [follow this link](https://prisma.typegraphql.com/docs/basics/configuration/).\n\n# 🚀 Runner \n### index.ts\nHere we have an index file that will create and run our server.\n\n# ⚙️ Configuration \n### apollo.ts\nI don't want to explain all about how to build a project with apollo, graphql and etc. so w'll talk only about specific configuration.\n\nAll we need to create a server with `apollo` is here.\n\n### app.ts\nwe need to create an express app to handle upload files (remove it if you doesn't have upload in your project but pay attention to clear usage from `index.ts` ).\n`graphql-upload` is a package to handle upload in our graphql project and we use it as middleware.\n\n### context.ts\nwe need to access `prismaClient` and user in all of our project so we have to define them in context.\n\n# ![GraphQL-icon](https://s4.uupload.ir/files/graphql_u69v.png) GraphQL\n### Inputs\nWe defined our input structures with `type-graphql` in this directory, inputs will used to control input fields in requests.\n\nfor example login input:\n``` typescript\nimport { InputType, Field } from  'type-graphql';\n\n@InputType()\nexport  class  LoginInput {\n\t@Field()\n\tusername: string;\n\t@Field()\n\tpassword: string;\n}\n```\n### Interfaces\nInterface is different from inputs, we will use this interfaces in project but inputs are for validation requests.\n\nfor example Upload :\n``` typescript\nimport { Stream } from  'stream';\n\nexport  interface  Upload {\n\tfilename: string;\n\tmimetype: string;\n\tencoding: string;\n\tcreateReadStream: () =\u003e  Stream;\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpariazar%2Fgraphql-boilerplates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpariazar%2Fgraphql-boilerplates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpariazar%2Fgraphql-boilerplates/lists"}