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
@audiBookning Sounds interesting, I didn't think about it. I like graphql-custom-types but I'm not sure if it plays nicely with Apollo. I'd wait to see if this pattern gets a wider adoption.
I looked for your feedback, because i don't really see Custom Scalar types being used or mentioned very much. Which is strange given that the specs of graphql already have this feature since at least 2015: facebook.github.io Scalars, more info also at graphql.org Scalar types
and also from what i can see, they are already implemented on Apollo Server 2 since the beginning: apollographql.com Custom scalars
The problem that could arise would be with Apollo Client. There is a rich issue about the matter: Support for custom scalars and its follow up from the apollo-feature-requests repo
TL;DR from Apollo site:
'...Note that Apollo Client does not currently have a way to automatically interpret custom scalars, so there’s no way to automatically reverse the serialization on the client...'
I haven't tried yet, but it does makes one wonder nonetheless...
I'd wait to see if this pattern gets a wider adoption.
Your doubts are likely similar to mine. But from what i gleaned, i does look like this should be the best practice to do validation (and much more) with Graphql on the server. There must be others considerations that i don't see at the moment...
From your video MERN Stack & GraphQL - #7 Server-Side Validation, it seems that you don't approach the subject of using custom scalar types for validation.
There are already several packages that use that idea:
What are your thought about it?
The text was updated successfully, but these errors were encountered: