graphqlgen
graphqlgen copied to clipboard
Prisma scaffolding plugin
Once we're supporting GraphQL directives (see #83) and a plugin system (see #84), there could be a Prisma plugin that automatically scaffolds the relation resolvers (similar to the forwardTo
functionality of graphql-binding
). Here is an example (syntax still WIP):
schema.graphql
# import Post from '../generated/prisma.graphql'
type Query {
feed: [Post!]! @prisma(query: "posts")
}
Further idea: This combined with the usage of graphql-import
could lead to a very concise and minimal setup where for most cases it's enough to change something in your datamodel.prisma
and the schema.graphql
file + resolvers will be adjusted automatically.
From this discussion, Nikolas mentions that "It is true that the client requires you to implement type resolvers for types that have relations to other types"
Just trying to understand - does this idea solve that use case? I am having to define lots of type resolvers for relations that I did not have to write under prisma-bindings, it's quite a bit of boilerplate code
@schickling Any update on this? When adding new relation fields in my datamodel.prisma
I have to add boilerplate resolvers, and these are adding up quickly