1 to 1 mapping with persistence schema ?
tlvenn opened this issue · 1 comments
Hi,
One of the greatest benefit of GraphQL is that it gives your application a strong typing system you can rely on but that graph does not have to map 1 for 1 with a given persistence engine. For example a given attribute in Graphql could come from a rating service while everything else is coming from Mongo.
It seems to me that right now, by trying to import the models from Mongo, we loose the ability to enhance or complement that GraphQL Schema so it can be more that just what our persistence engine is providing.
I think it's great if Graffiti can help so you dont have to repeat yourself twice on how you declare your schema but at the same time, it is equally important that graffiti gives us the opportunity to add stuff or override stuff in the GraphQL schema as well.
@tlvenn I think it's a good idea however I don't see the right solution for that yet.
In graffiti-mongoose
we already exposed to getting only the generated types instead of the whole schema.
I think it's a good step to a more flexible direction.
Please ping me if you have anything in your mind about the correct solution.