question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

enable type casting

See original GitHub issue

One 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:open
  • Created 6 years ago
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
IvanGoncharovcommented, Nov 10, 2017

I will try to find some time on this weekend to release alpha version. So you could test it by implementing toDate.

1reaction
MrLohcommented, Nov 10, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found