Hey Guys What would be the best way to implement ...
# orm-help
m
Hey Guys What would be the best way to implement custom scalars. I know that i can overwrite the schema.graphql but what if i have to use the custom scalar y many quries and mutations?
d
My understanding is that your schema.graphql should be much simpler then the generated prisma.graphql. You should only expose the information that is needed. Personally, I've overridden about ~200 lines in my schema.graphql. So I copy and paste big chunks into my schema.graphql. I imagine an alternative is to have your own generated schema.graphql. Checkout https://www.apollographql.com/docs/graphql-tools/schema-transforms.html if you take that approach. Would be happy to hear what others are doing as I'm guessing some best practices will develop.
n
thanks a lot for bringing this up @danielrasmuson! what are the biggest issues you run into/the most time intensive tasks? There are already some discussions (like https://github.com/graphql-binding/graphql-binding/issues/40) that help us improve these workflows . Would love to collect more insights into this topic!
@mglcarmona I don't see the problem with adding the custom scalar to
schema.graphql
, can you elaborate what the downside is?