-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FileUpload] Allow to encode custom scalar types as null and use it for file uploads #2566
Conversation
Ping @meiblorn. Sorry for the delay getting this in, let me know if this looks good for you. |
@martinbonnin, thanks a lot. I haven't tested it yet, but overall it looks good. |
@@ -80,6 +80,7 @@ class InputFieldJsonWriter( | |||
is GraphQLString -> writeString(fieldName, customTypeValue.value) | |||
is GraphQLBoolean -> writeBoolean(fieldName, customTypeValue.value) | |||
is GraphQLNumber -> writeNumber(fieldName, customTypeValue.value) | |||
is GraphQLNull -> writeString(fieldName, null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should we introduce writeNull
to our JsonWriter
? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JsonWriter
already has nullValue
, would that be ok?
We could also add writeNull
to InputFieldWriter
but that would be a much more invasive change that I'm not too keen on doing in 2.x. Falling into the rabbit hole of InputFieldsWriters
, I realized that SortedInputFieldMapWriter
doesn't handle custom scalar types. So custom scalars as field arguments will most likely fill the cache with different values. I guess something to keep in mind for 3.x
fixes #2409