enable type casting
See original GitHub issueOne of the very common transformations I need (except from the ones that this library already enables) is casting a value into a Date. Would it be possible to add a function for that like:
movie {
title
releaseDate @_(as: "Date")
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (4 by maintainers)
Top Results From Across the Web
Type Casting - TypeScript Tutorial
Type castings allow you to convert a variable from one type to another. In TypeScript, you can use the as keyword or <>...
Read more >Type conversions - CPlusPlus.com
Unrestricted explicit type-casting allows to convert any pointer into any other pointer type, independently of the types they point to. The subsequent call...
Read more >Casting and type conversions - C# Programming Guide
A cast is a way of explicitly informing the compiler that you intend to make the conversion and that you are aware that...
Read more >C - Type Casting - Tutorialspoint
Type conversions can be implicit which is performed by the compiler automatically, or it can be specified explicitly through the use of the...
Read more >Object Type Casting in Java - Baeldung
An overview of type casting in Java, covered with simple and easy to ... to downcast to an unrelated type, the compiler won't...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I will try to find some time on this weekend to release
alpha
version. So you could test it by implementingtoDate
.Yeah, that makes a lot of sense totally convinced that this is not a good idea to include it for the reasons you mention. Don’t overload the library with too much functionality, that can lead to confusion.
I think allowing custom extensions would hit the sweet spot, as it keeps the library clean and surface area for bugs small and gives developers the freedom to extend it with what they need.