Initial public release of Warp.
Repo-Sync-Origin: warpdotdev/warp-internal@12af1d983b
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
use crate::scalars::Time;
|
||||
use crate::{
|
||||
error::UserFacingError, notebook::Notebook, object::ObjectUpdateSuccess,
|
||||
request_context::RequestContext, response_context::ResponseContext, schema,
|
||||
};
|
||||
|
||||
#[derive(cynic::QueryVariables, Debug)]
|
||||
pub struct UpdateNotebookVariables {
|
||||
pub input: UpdateNotebookInput,
|
||||
pub request_context: RequestContext,
|
||||
}
|
||||
|
||||
#[derive(cynic::QueryFragment, Debug)]
|
||||
pub struct UpdateNotebookOutput {
|
||||
pub response_context: ResponseContext,
|
||||
pub update: NotebookUpdate,
|
||||
}
|
||||
|
||||
#[derive(cynic::QueryFragment, Debug)]
|
||||
#[cynic(graphql_type = "RootMutation", variables = "UpdateNotebookVariables")]
|
||||
pub struct UpdateNotebook {
|
||||
#[arguments(input: $input, requestContext: $request_context)]
|
||||
pub update_notebook: UpdateNotebookResult,
|
||||
}
|
||||
crate::client::define_operation! {
|
||||
update_notebook(UpdateNotebookVariables) -> UpdateNotebook;
|
||||
}
|
||||
|
||||
#[derive(cynic::QueryFragment, Debug)]
|
||||
pub struct NotebookUpdateRejected {
|
||||
pub conflicting_notebook: Notebook,
|
||||
pub revision_ts: Time,
|
||||
}
|
||||
|
||||
#[derive(cynic::InlineFragments, Debug)]
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
pub enum NotebookUpdate {
|
||||
NotebookUpdateRejected(NotebookUpdateRejected),
|
||||
ObjectUpdateSuccess(ObjectUpdateSuccess),
|
||||
#[cynic(fallback)]
|
||||
Unknown,
|
||||
}
|
||||
|
||||
#[derive(cynic::InlineFragments, Debug)]
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
pub enum UpdateNotebookResult {
|
||||
UpdateNotebookOutput(UpdateNotebookOutput),
|
||||
UserFacingError(UserFacingError),
|
||||
#[cynic(fallback)]
|
||||
Unknown,
|
||||
}
|
||||
|
||||
#[derive(cynic::InputObject, Debug)]
|
||||
pub struct UpdateNotebookInput {
|
||||
pub data: Option<String>,
|
||||
pub revision_ts: Option<Time>,
|
||||
pub title: Option<String>,
|
||||
pub uid: cynic::Id,
|
||||
}
|
||||
Reference in New Issue
Block a user