Replies: 2 comments 1 reply
-
Thanks @MichalLytek! Can you elaborate if the runtime code using custom scalars hooks them into the GraphQL validation phase or if all validation still happens in the execution phase? I see that the schema gets updated with expected custom scalar, but afaict in terms of validation, it is still validated in execute phase? But maybe I have some issue in my setup (federated apollo schema with a custom scalar in a subgraph). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
GraphQL has a pipeline which is
Currently, afaict,
type-graphql
does all it's "validation" in the execute step, which works but it is not ideal. It feels unlike canonic GraphQL to validate stuff in resolvers (a shortcut taken by authors?) since resolvers should have received already parsed and validated data.Now, if I want to write proper GraphQL scalars to parse and validate input, how do I achieve that using
type-graphql
? Is it even possible? It feels like it should be 100% possible to infer the graphql type from it and that there should be helpers to get it, and that type-graphql shouldn't even do validation inexecute
step if this pattern is used.But all I am getting is
Example, if I have custom scalar such as this:
Beta Was this translation helpful? Give feedback.
All reactions