IssueRaiser

Support for an Interface type

## Problem On large schemas you may want to ensure that a model conforms to a specific shape. This often allows for better compatibility across the system. The motivation for Interfaces in Prisma is similar to [GraphQL's motivation](https://graphql.org/learn/schema/#interfaces). ## Suggested solution So far we've been thinking about this purely at the Prisma-level. It's checked by our tooling, but does not live in the database at all. Something like: ```groovy interface Character { id Int @id name String friends Character[] } model Human implements Character { id Int @id name String friends Character[] totalCredits Int } model Droid implements Character { id Int @id name String friends Character[] primaryFunction String } ```

Posted by matthewmueller on May 18, 2020, 3:52 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments

support (Other)

Support for an Interface type

matthewmuellerMay 18, 2020, 3:52 PM

## Problem On large schemas you may want to ensure that a model conforms to a specific shape. This often allows for better compatibility across the system. The motivation for Interfaces in Prisma is similar to [GraphQL's motivation](https://graphql.org/learn/schema/#interfaces). ## Suggested solution So far we've been thinking about this purely at the Prisma-level. It's checked by our tooling, but does not live in the database at all. Something like: ```groovy interface Character { id Int @id name String friends Character[] } model Human implements Character { id Int @id name String friends Character[] totalCredits Int } model Droid implements Character { id Int @id name String friends Character[] primaryFunction String } ```

Comments (0)

No comments yet. Start the discussion.

Comment on this issue