What feature are you missing?
Currently, it doesn't seem possible to separate the Prisma data model into more than one file. It should be possible to import multiple types into a data model, without containing them all in the same file. This gets messy for large data sets.
How could this feature look like in detail? Tradeoffs?
This could be fixed by adding graphql-import to the deploy chain, so # import Type from "Type.graphql" will work. Eventually, it would be nice to allow specifying a directory for the data model instead of a single file, which would cause all .graphql/ .gql files in the directory to be included in the data model.
It is possible to provide a list of .graphql files to the datamodel property in prisma.yml:
datamodel:
- datamodel/types.graphql
- datamodel/enums.graphql
You can see how this looks like in action in this example.
Would that cover your use case already?
Apart from that, maybe there could be a pre-hook system for prisma deploy, where you could configure your preprocessing steps manually.
Yes, that does cover my use case and is what I am currently using, however my list of imports in prisma.yml is quite long, so it would be nicer to import one datamodel.graphql file which utilize graphql-import.
@marktani while the list form works, it loses type referencing in each file. i.e. there will be no type check via graphql-import, which is said to be the next feature for the VS Code plugin.
What's your thought?
define all data models in one single big file is ugly to me :C
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.
Most helpful comment
@marktani while the list form works, it loses type referencing in each file. i.e. there will be no type check via
graphql-import, which is said to be the next feature for the VS Code plugin.What's your thought?