Closed Compulsed closed 10 months ago
@Compulsed sorry for a bit late reply on this.
We have Nullable
enum for distinguishing between explicit and implicit null
s. It's also covered in the "Implicit and explicit null" chapter of the Book.
@tyranron -- this is exactly what I was looking for. Thank you for point this out!
Is your feature request related to a problem? Please describe. Would like to be able to determine if the key has been explicitly set to null, OR is not included. This functionality is useful for performing partial updates. At the moment (options below), 2/ & 3/ are represented as as
None
.When working with GraphQL / JSON there are three states:
{"name": "Frank"}
{"name": null}
{}
Describe the solution you'd like Would like to have a custom InputScalar which is a enum type
Describe alternatives you've considered Another option might be to surface this up as some kind of dictionary type, though, I think this would be difficult because the Input types are used to generate the GraphQL schema.
Additional context Let me know if anyone has a custom solution, I am not sure how I would be able to achieve this (even if it is possible) with the existing custom scalar functionality.
https://graphql-rust.github.io/juniper/master/types/scalars.html