You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a couple issues with Candid, and I do not have time to address them right now, so I have disabled deriving Candid and trying to do this in Rust. This means that custom resolvers do not work anymore. Once the following issues are resolved, we can reenable CandidType and thus custom resolvers. But custom resolvers probably won't be very useful until we have some kind of authorization at the schema level anyway, since currently there is no way to have authorization on a custom resolver without allowing arbitrary access to object type queries.
I need to be able to add the CandidType derive macro attribute, but it doesn't work for serde_json::Value. So I either need to implement my own Value type that is a custom scalar, or the candid library needs to implement CandidType for serde_json::Value, I am not sure there is any other way right now since CandidType and serde_json::Value or both defined outside of my crate. See here for some more information, I want to push for the candid library to provide this implementation, since it will be so common: https://forum.dfinity.org/t/derive-candidtype-with-serde-json/5800
I could also consider forking candid again and adding the functionality myself, but it was so painful to fork last time, I really am not sure it even works
I am waiting for ic-cdk to release a new version that has the new candid library version, then I can use the candid_path macro attribute and I don't need to force users to include ic-cdk directly. It would be nice for this to be included
Maybe they would allow a pull request for serde_json::Value, if so I should offer to do the work
The text was updated successfully, but these errors were encountered:
lastmjs
changed the title
Reenable Candid
Reenable Candid and Custom Resolvers
Jul 9, 2021
There are a couple issues with Candid, and I do not have time to address them right now, so I have disabled deriving Candid and trying to do this in Rust. This means that custom resolvers do not work anymore. Once the following issues are resolved, we can reenable CandidType and thus custom resolvers. But custom resolvers probably won't be very useful until we have some kind of authorization at the schema level anyway, since currently there is no way to have authorization on a custom resolver without allowing arbitrary access to object type queries.
CandidType
derive macro attribute, but it doesn't work forserde_json::Value
. So I either need to implement my ownValue
type that is a custom scalar, or the candid library needs to implementCandidType
for serde_json::Value, I am not sure there is any other way right now sinceCandidType
andserde_json::Value
or both defined outside of my crate. See here for some more information, I want to push for the candid library to provide this implementation, since it will be so common: https://forum.dfinity.org/t/derive-candidtype-with-serde-json/5800candid_path
macro attribute and I don't need to force users to includeic-cdk
directly. It would be nice for this to be includedserde_json::Value
, if so I should offer to do the workThe text was updated successfully, but these errors were encountered: