pub struct Change {
pub path: String,
pub kind: ChangeKind,
pub span: Span,
}Expand description
A change that represents a meaningful difference between the two schemas. Changes have a
direction: from source to target. For example, if kind is AddField, it means the field does
not exist in the source schema but it does exist in the target schema.
Fields§
§path: StringWhere the change happened in the schema. It is dot separated where relevant. For example if
the change happened in a field argument, the path will be something like
ParentTypeName.fieldName.argumentName.
See crate::path::Path for the full documentation.
kind: ChangeKindThe nature of the change.
span: SpanContents depend on the change kind:
- [ChangeQueryType]/[ChangeMutationType]/[ChangeSubscriptionType]: the new type
- [AddObjectType]/[AddUnion]/[AddEnum]/[AddScalar]/[AddInterface]/[AddInputObject]/[AddSchemaDefinition]/[AddDirectiveDefinition]: the whole definition.
- [AddInterfaceImplementation]/[RemoveInterfaceImplementation]: empty
- [ChangeFieldType]/[ChangeFieldArgumentType]: the new type
- [RemoveObjectType]/[RemoveField]/[RemoveUnion]/[RemoveUnionMember]/[RemoveEnum]/[RemoveScalar]/[RemoveInterface]/[RemoveDirectiveDefinition]/[RemoveSchemaDefinition]/[RemoveInputObject]/[RemoveFieldArgument]/[RemoveFieldArgumentDefault]: empty
- [AddField]: the whole field definition
- [AddUnionMember]: the union member added
- [AddEnumValue]/[RemoveEnumValue]: empty
- [AddFieldArgument]: the value of the argument, potentially with the default
- [AddFieldArgumentDefault]/[ChangeFieldArgumentDefault]: the default value of the argument
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Change
impl<'de> Deserialize<'de> for Change
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Change
Source§impl Ord for Change
impl Ord for Change
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Change
impl PartialOrd for Change
impl StructuralPartialEq for Change
Auto Trait Implementations§
impl Freeze for Change
impl RefUnwindSafe for Change
impl Send for Change
impl Sync for Change
impl Unpin for Change
impl UnsafeUnpin for Change
impl UnwindSafe for Change
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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§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
Compare self to
key and return true if they are equal.