pub struct Change {
pub path: String,
pub kind: ChangeKind,
pub span: Span,
pub source_span: Option<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
- [ChangeDescription]: the new description, or empty if the description was removed
source_span: Option<Span>The span of the corresponding content in the source schema, when there is meaningful
content there to point to. None otherwise, in particular for change kinds where the item
only exists in the target schema (e.g. [AddField]) or carries no content on either side
(e.g. [AddInterfaceImplementation]/[RemoveInterfaceImplementation]).
Currently populated for:
- [ChangeFieldType]/[ChangeFieldArgumentType]: the old type
- [ChangeFieldArgumentDefault]: the old default value of the argument
- [ChangeDescription]: the old description, or
Noneif the description was added - [RemoveField]/[RemoveEnumValue]/[RemoveUnionMember]: the removed field/value/member
- [RemoveFieldArgument]: the removed argument
- [RemoveFieldArgumentDefault]: the removed default value of the argument
- [RemoveSchemaDefinition]: the removed schema definition
- [RemoveDirective]: the removed directive usage
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>,
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,
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
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
key and return true if they are equal.