Skip to content

Commit

Permalink
first half of magical mutation fields work?
Browse files Browse the repository at this point in the history
  • Loading branch information
rbalicki2 committed Dec 4, 2023
1 parent b03d32f commit 453b8fb
Show file tree
Hide file tree
Showing 3 changed files with 330 additions and 58 deletions.
15 changes: 15 additions & 0 deletions crates/graphql_lang_types/src/type_annotation.rs
Expand Up @@ -18,6 +18,14 @@ impl<TValue> TypeAnnotation<TValue> {
}
}

pub fn inner_mut(&mut self) -> &mut TValue {
match self {
TypeAnnotation::Named(named) => &mut named.0.item,
TypeAnnotation::List(list) => list.0.inner_mut(),
TypeAnnotation::NonNull(non_null) => non_null.inner_mut(),
}
}

pub fn map<F, TNewValue>(self, f: F) -> TypeAnnotation<TNewValue>
where
F: FnOnce(TValue) -> TNewValue,
Expand Down Expand Up @@ -84,6 +92,13 @@ impl<TValue> NonNullTypeAnnotation<TValue> {
}
}

pub fn inner_mut(&mut self) -> &mut TValue {
match self {
NonNullTypeAnnotation::Named(named) => &mut named.0.item,
NonNullTypeAnnotation::List(list) => list.0.inner_mut(),
}
}

pub fn map<F, TNewValue>(self, f: F) -> NonNullTypeAnnotation<TNewValue>
where
F: FnOnce(TValue) -> TNewValue,
Expand Down
1 change: 1 addition & 0 deletions crates/isograph_schema/src/isograph_schema.rs
Expand Up @@ -453,6 +453,7 @@ pub struct SchemaObject<TEncounteredField> {
pub server_fields: Vec<ServerFieldId>,
pub resolvers: Vec<ResolverFieldId>,
pub encountered_fields: HashMap<SelectableFieldName, TEncounteredField>,
/// This is an unused field right now, I think.
pub valid_refinements: Vec<ValidRefinement>,
}
// TODO iterator of fields that includes id_field?
Expand Down

0 comments on commit 453b8fb

Please sign in to comment.