-
Notifications
You must be signed in to change notification settings - Fork 717
-
Notifications
You must be signed in to change notification settings - Fork 717
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
Custom scalar isn't being respected #3371
Comments
Hi @solidcell - is the data value being sent as regular JSON bool? Something like this:
|
Yea. In this case it's |
Are you able to share the definition for |
OK, I think the issue is your implementation of Here is a sample project which defines a custom scalar pretty similar to yours just with less variants to it. The test passes with the custom scalar type being returned as expected. In the custom scalar file there is a commented out portion with the same tl;dr - remove your |
That was it, thanks! I was waiting to trim code until things started working 🤦 Appreciate your help! |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better. |
Summary
https://www.loom.com/share/c6faff0cb93f4c9b85342cdb9053e52c?sid=ed020aee-67eb-4831-9832-4b5645a4535a
I've defined a custom scalar
BasicScalar
which is seemingly not being respected/used for a field which is defined asresult: BasicScalar!
. Instead, theDataDict
ends up havingresult: AnyHashable(Bool)
. So instead of it decoding the query so thatresult
isBasicScalar
(.bool(true)
), it's decodingresult
as plaintrue
and not using theBasicScalar
type at all, as the GraphQL schema specifies. What am I doing wrong? My schema, operation, and custom scalar all seem to be defined accordingly, yet..Version
1.9.0
Steps to reproduce the behavior
See the summary.
Logs
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: