{"id":19647624,"url":"https://github.com/fklc/graphql-prisma-select-fields","last_synced_at":"2026-06-13T17:02:43.522Z","repository":{"id":114025832,"uuid":"504998025","full_name":"FKLC/graphql-prisma-select-fields","owner":"FKLC","description":"Helper library to convert GraphQL document fields to Prisma's select argument","archived":false,"fork":false,"pushed_at":"2022-06-19T02:59:22.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-27T00:27:07.516Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/FKLC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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-06-19T02:55:05.000Z","updated_at":"2022-06-19T02:59:25.000Z","dependencies_parsed_at":"2023-07-23T16:01:15.552Z","dependency_job_id":null,"html_url":"https://github.com/FKLC/graphql-prisma-select-fields","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FKLC/graphql-prisma-select-fields","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FKLC%2Fgraphql-prisma-select-fields","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FKLC%2Fgraphql-prisma-select-fields/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FKLC%2Fgraphql-prisma-select-fields/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FKLC%2Fgraphql-prisma-select-fields/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FKLC","download_url":"https://codeload.github.com/FKLC/graphql-prisma-select-fields/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FKLC%2Fgraphql-prisma-select-fields/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34292326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"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-11T14:44:41.104Z","updated_at":"2026-06-13T17:02:43.504Z","avatar_url":"https://github.com/FKLC.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# graphql-prisma-select-fields\nThis is a small helper library that helps you not over-fetch while using GraphQL with Prisma.\n\n### Example\n```js\nimport gqlSelectConverter from 'graphql-prisma-select-fields'\n\nconst app = fastify()\n\napp.register(mercurius, {\n  ...,\n})\n\n\napp.ready().then(() =\u003e {\n  app.graphql.addHook('preExecution', async (schema, document, context) =\u003e {\n    context['selectFields'] = gqlSelectConverter(document)\n    ...\n  })\n})\n\n\n// Models\nexport const ModelQuery = extendType({\n  type: 'Query',\n  definition(t) {\n    t.nonNull.list.field('models', {\n      type: Model,\n      resolve(source, args, ctx) {\n        return ctx.prisma.account.findMany(ctx.selectFields.Model)\n      }\n    })\n  },\n})\n```\n\nNote that this is a really small library. You can customize it as you wish to fit to your codebase.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffklc%2Fgraphql-prisma-select-fields","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffklc%2Fgraphql-prisma-select-fields","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffklc%2Fgraphql-prisma-select-fields/lists"}