-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add GraphQL client API #119
Conversation
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.
Hey, thanks for this, all the changes look good! However I think it makes sense to base this PR off the development
branch. As there have been/will be a series of breaking changes (removing JSON rpc etc...) we are merging into there for now. In development
you already have access to the initial storage provider implementation, so you would be able to use next_entry_args()
and publish_entry()
and all other existing higher level storage methods there.
Oops, forgot something |
I added a utility in pub struct EntryArgsResponse {
#[serde(with = "log_id_string_serialisation")]
pub log_id: LogId,
#[serde(with = "seq_num_string_serialisation")]
pub seq_num: SeqNum,
pub backlink: Option<Hash>,
pub skiplink: Option<Hash>,
} and then |
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.
This all looks good! Great to have the client GraphQL being introduced and finally completely removing JSON RPC.
Interesting to see what we can do with the string serialisation definitions too 👍
/// Serialise log id as strings. | ||
/// | ||
/// To be used as a parameter for Serde's `with` field attribute. | ||
#[allow(dead_code)] | ||
pub mod log_id_string_serialisation { |
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.
This is very cool! It's similar to what I was trying to do in the context of storing and retrieving p2panda types from the db where they are mostly strings: #89
I prefer your approach as it seems more generally useful. I don't know if it is a drop-in solution to for the db stuff though. Definitely let's keep an eye on it and see if we want to implement it in p2panda-rs
and then try to use for the db models.
Replaces the "ping" placeholder with a GraphQL API for p2panda clients.
rpc
module and finally delete thatLogId
andSeqNum
asString
#60
Next
📋 Checklist
CHANGELOG.md