You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the Mongoose Schema provides us with an incredibly easy and smooth way to generate a GraphQL Schema. However, there are some instances where we may want to use a different GraphQL type than our underlying mongodb type. While customQueries and customQueries solves this to some extent, 'baking' in the the functionality to graffiti-mongoose seems advantageous moving forward.
An example of this is image upload. While the Mongoose Type for an image field might be a Schema.ID (an id for a gridfs file) our input has to be a string. This is just one example, I'm sure there are a bunch of other use cases too.
What I propose is to use a graffiti attribute that will be read by graffiti during the schema generation process. I figured we put every graffiti custom attribute here so as not to pollute the mongoose type object:
This is going to potentially need lots of changes, but will make graffiti-mongoose very powerful. If you think this is a good approach, let me know and I'll get started on a PR 😄
The text was updated successfully, but these errors were encountered:
Following the Mongoose Schema provides us with an incredibly easy and smooth way to generate a GraphQL Schema. However, there are some instances where we may want to use a different GraphQL type than our underlying mongodb type. While customQueries and customQueries solves this to some extent, 'baking' in the the functionality to graffiti-mongoose seems advantageous moving forward.
An example of this is image upload. While the Mongoose Type for an
image
field might be aSchema.ID
(an id for a gridfs file) our input has to be a string. This is just one example, I'm sure there are a bunch of other use cases too.What I propose is to use a graffiti attribute that will be read by graffiti during the schema generation process. I figured we put every graffiti custom attribute here so as not to pollute the mongoose type object:
This is going to potentially need lots of changes, but will make graffiti-mongoose very powerful. If you think this is a good approach, let me know and I'll get started on a PR 😄
The text was updated successfully, but these errors were encountered: