Class

sri.relay.mutation

RelayMutation

Related Doc: package mutation

Permalink

abstract class RelayMutation extends RelayMutationJS

Annotations
@RawJSType() @ScalaJSDefined()
Linear Supertypes
RelayMutationJS, Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RelayMutation
  2. RelayMutationJS
  3. Object
  4. Any
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RelayMutation(initialProps: Dynamic)

    Permalink

Abstract Value Members

  1. abstract def getConfigs(): RelayMutationConfig

    Permalink

    These configurations are used to generate the query for the mutation to be sent to the server and to correctly write the server's response into the client store.

    These configurations are used to generate the query for the mutation to be sent to the server and to correctly write the server's response into the client store.

    Possible configuration types:

    - FIELDS_CHANGE provides configuration for mutation fields. { type: RelayMutationType.FIELDS_CHANGE; fieldIDs: {[fieldName: string]: DataID | Array<DataID>}; } where fieldIDs map fieldNames from the fatQuery to a DataID or array of DataIDs to be updated in the store.

    - RANGE_ADD provides configuration for adding a new edge to a range. { type: RelayMutationType.RANGE_ADD; parentName: string; parentID: string; connectionName: string; edgeName: string; rangeBehaviors: {[call: string]: GraphQLMutatorConstants.RANGE_OPERATIONS}; } where parentName is the field in the fatQuery that contains the range, parentID is the DataID of parentName in the store, connectionName is the name of the range, edgeName is the name of the key in server response that contains the newly created edge, rangeBehaviors maps stringified representation of calls on the connection to GraphQLMutatorConstants.RANGE_OPERATIONS.

    - NODE_DELETE provides configuration for deleting a node and the corresponding edge from a range. { type: RelayMutationType.NODE_DELETE; parentName: string; parentID: string; connectionName: string; deletedIDFieldName: string; } where parentName, parentID and connectionName refer to the same things as in RANGE_ADD, deletedIDFieldName is the name of the key in the server response that contains the DataID of the deleted node.

    - RANGE_DELETE provides configuration for deleting an edge from a range but doesn't delete the node. { type: RelayMutationType.RANGE_DELETE; parentName: string; parentID: string; connectionName: string; deletedIDFieldName: string; pathToConnection: Array<string>; } where parentName, parentID, connectionName and deletedIDFieldName refer to the same things as in NODE_DELETE, pathToConnection provides a path from parentName to connectionName.

    - REQUIRED_CHILDREN is used to append additional children (fragments or fields) to the mutation query. Any data fetched as a result of these children is not written to the client store. Please avoid using this. { type: RelayMutationType.REQUIRED_CHILDREN; children: Array<RelayQuery.Node>; }

  2. abstract def getFatQuery(): Any

    Permalink

    "Fat queries" represent a predetermined set of fields that may change as a result of a mutation, and which should therefore be queried in order to get a consistent view of the data after performing a mutation.

    "Fat queries" represent a predetermined set of fields that may change as a result of a mutation, and which should therefore be queried in order to get a consistent view of the data after performing a mutation. In practice, we query for a subset of those fields because we intersect the fat query with the tracked query we have for a given node (ie. the pieces of data we've previously queried for and have therefore written to the store).

    Fat queries can be written like normal graphql queries with one main exception: fat queries use childless non-scalar fields to indicate that anything under that field may change. For example, the fat query for feedback_like contains the field like_sentence with no child fields. This means that any field below like_sentence may change as a result of feedback_like.

    When adding a fat query, consider *all* of the data that might change as a result of the mutation - not just data that we currently use in Relay. We don't need to worry about overfetching here (this query is never executed on its own; the infrastructure always intersects it with what is actually needed), and if we omit fields here we might get odd consistency behavior in the future when we add new views or modify existing ones.

  3. abstract def getMutation(): MutationFragment

    Permalink

    Each mutation has a server name which is used by clients to communicate the type of mutation that should be executed on the server.

  4. abstract def getVariables(): Object

    Permalink

    These variables form the "input" to the mutation query sent to the server.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. val fragments: Any

    Permalink
    Definition Classes
    RelayMutationJS
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def getCollisionKey(): UndefOr[String]

    Permalink

    An optional collision key allows a mutation to identify itself with other mutations that affect the same fields.

    An optional collision key allows a mutation to identify itself with other mutations that affect the same fields. Mutations with the same collision are sent to the server serially and in-order to avoid unpredictable and potentially incorrect behavior.

    Definition Classes
    RelayMutationJS
  12. def getFiles(): UndefOr[FileMap]

    Permalink

    These will be sent along with the mutation query to the server.

    These will be sent along with the mutation query to the server.

    Definition Classes
    RelayMutationJS
  13. def getOptimisticConfigs(): UndefOr[Seq[Dictionary[Any]]]

    Permalink

    Optional.

    Optional. Similar to getConfig, this is used to create the query corresponding to the optimisticResponse. If not provided, the query will be inferred from the optimistic response. Most subclasses shouldn't need to extend this method.

    Definition Classes
    RelayMutationJS
  14. def getOptimisticResponse(): UndefOr[Object]

    Permalink

    When a request is sent to the server, mutations can optionally construct an optimistic response that has the same shape as the server response payload.

    When a request is sent to the server, mutations can optionally construct an optimistic response that has the same shape as the server response payload. This optimistic response is used to pre-emptively update the client cache to simulate an instantaneous response.

    The optimistic response may be a subset or superset of the actual response payload. It can be a subset if certain fields are impossible to create on the client (and if views are expected to handle the data inconsistency). It can be a superset of the actual response payload if certain fields that are affected have not been queried by the client, yet.

    Definition Classes
    RelayMutationJS
  15. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  16. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  19. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  23. var props: Dynamic

    Permalink
    Definition Classes
    RelayMutationJS
  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  25. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  26. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  27. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  28. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from RelayMutationJS

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped