ardatan / ardatan/graphql-import

Idea: Redesign type definitions/code generation to avoid repetitive type definitions on server and prisma side

Open
#51 5 comments 6 reactions 0 assignees View on GitHub
discussion
Dominant language
No language data
Stars
864
Forks
53
PR merge metrics
No merged PRs in 30d

Description

Hi, I have an idea/suggestion. I find it a little bit tedious to always copy/paste my graphql datamodels from the prisma backend to the server graphql type definition file, 90% of my models are reused anyway. Wouldnt it be possible to simply add an anotation like "expose" and "private" to the prisma type definitions and their parameters and include the types in the code generation process? with default to "private", this would not change the current behavior and could be handy to quickly export the types you want to expose from prisma in a DRY manner without having to copy paste the common types all the time. additionally, it might be nice to also make overriding these in the server portion of the app a more conscious process with an "extends" or "overrides" annotation or keyword on altering type definitions.

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names Prisma type definitions, server GraphQL type definitions, and the code-generation process, but no files or tests. Start by mapping how definitions currently move between Prisma and the server, then determine whether annotations and override semantics can be specified; done would require an agreed design and implementation plan.

Written by the indexing model from the issue text.

Assessment

Domain
api, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.