pub enum InputStyle {
Flatten,
Jsonb,
}Expand description
How a mutation’s GraphQL input argument is forwarded to its SQL function.
This is orthogonal to MutationOperation (the DML verb). Decoupling
the input-passing style from the verb lets a backend that uses the
single-JSONB wrapper convention
(fn(input_payload jsonb, …) RETURNS app.mutation_response) register the
real operation (Insert/Delete/Custom) instead of being forced to
Update purely to opt into single-JSONB passing — which in turn lets the
Change Spine record the true modification_type.
§Example
use fraiseql_core::schema::InputStyle;
assert_eq!(InputStyle::default(), InputStyle::Flatten);
assert!(InputStyle::Flatten.is_flatten());
assert!(!InputStyle::Jsonb.is_flatten());Variants§
Flatten
Flatten the Input type’s fields into positional SQL arguments.
The default and today’s behavior for Insert/Delete/Custom
mutations whose input is a known Input type.
Jsonb
Forward the entire input object as a single jsonb argument.
Mirrors how Update mutations (and a raw input: JSON arg) are passed
today, including the #400 acronym-aware input-key recasing on that
path.
Implementations§
Source§impl InputStyle
impl InputStyle
Sourcepub const fn is_flatten(&self) -> bool
pub const fn is_flatten(&self) -> bool
Whether this is the Flatten default.
Used as the serde skip_serializing_if predicate so a flatten
mutation serializes byte-identically to one authored before this field
existed, leaving the codegen schema hash unchanged.
Trait Implementations§
Source§impl Clone for InputStyle
impl Clone for InputStyle
Source§fn clone(&self) -> InputStyle
fn clone(&self) -> InputStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for InputStyle
Source§impl Debug for InputStyle
impl Debug for InputStyle
Source§impl Default for InputStyle
impl Default for InputStyle
Source§fn default() -> InputStyle
fn default() -> InputStyle
Source§impl<'de> Deserialize<'de> for InputStyle
impl<'de> Deserialize<'de> for InputStyle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for InputStyle
Source§impl PartialEq for InputStyle
impl PartialEq for InputStyle
Source§impl Serialize for InputStyle
impl Serialize for InputStyle
impl StructuralPartialEq for InputStyle
Auto Trait Implementations§
impl Freeze for InputStyle
impl RefUnwindSafe for InputStyle
impl Send for InputStyle
impl Sync for InputStyle
impl Unpin for InputStyle
impl UnsafeUnpin for InputStyle
impl UnwindSafe for InputStyle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.