Determine if this
and that
are deeply equal.
Performs a fast comparison of whether this
and that
represent identical
query nodes.
Performs a fast comparison of whether this
and that
represent identical
query nodes. Returns true only if the concrete nodes, routes, and variables
are all the same.
Note that it is possible that this method can return false in cases where
equals
would return true. This can happen when the concrete nodes are
different but structurally identical, or when the route/variables are
different but do not have an effect on the structure of the query.
internal
Queries in Relay are represented as trees. Possible nodes include the root, fields, and fragments. Fields can have children, or they can be leaf nodes. Root and fragment nodes must always have children.
RelayQueryNode
provides access to information such as the field name, generated alias, sub-fields, and call values.Nodes are immutable; query modification is supported via
clone
:var next = prev.clone(prev.getChildren().filter(f => ...));
Note: Mediating access to actual query nodes is necessary so that we can replace the current mutable GraphQL nodes with an immutable query representation. This class *must not* mutate the underlying
concreteNode
. Instead, use an instance variable (seeclone()
).TODO (#6937314): RelayQueryNode support for toJSON/fromJSON