v8.0.0
8.0.0
Commits: v7.1.0...v8.0.0
Breaking
- Relay Compiler no longer relies on the
graphql-js
schema representation. And consumes only SDL file that represents the schema. This means that all custom implementations relay compiler runners that were depended on the specifics of thegraphql-js
may not work as expected. Specifically, custom Enum values are no longer available in the relay-compiler - as they cannot be expressed via SDL. Also, custom functionparseValue
,parseLiteral
andserialize
that can be defined for a graphql type viagraphql-js
primitives are not accessible in the relay compiler: this may break serialization of custom scalars. 860c23c - Babel plugin no longer produces thunks: 490c89d
- Mutations are committed to unique root ids #2349. In mutation updaters, fields in the mutation will no longer be available in the store root returned from
store.getRoot
. Usages likestore.getRoot().getLinkedRecord('create_comment_mutation')
will break. - Removed internally unused
RelayRecordSourceProxy::commitPayload()
. Note that this method was not part of the public interface. - Signature of
RelayStore.retain()
changed to directly accept anOperationDescriptor
. An operation descriptor to pass toRelayStore.retain
()can be constructed using
createOperationDescriptoravailable in
relay-runtime`.
Added
- Allow language plugin to add schema extensions. #2935
- In
relay-compiler
we added support for variables in complex objects and arrays: 5da3be0 isClientID
helper is available to use inrelay-runtime
dac614c
Fixed
-
Remove the
clientMutationId
requirement by creating a new root id for each executed mutation: #2349 -
validateMutation
correctly handles lists of scalar fields in the optimistic payloads: 56795ba -
DissalowIDAsAlias
this validation had a bug, there it wasn't traversing LinkedFields, hence wasn't reporting violations in their selections. c4547f9 -
RelayModernFragmentSpecResolver
only holds on to fragment references as opposed to all props passed to product code to reduce amount of leaked memory when rendering in React concurrent mode. -
Fixed detecting whether the execution environment is a server: #2960
Misc
- Relay codebase is using explicit inexact objects: 4e2cc2f
- Added an
options
property onIEnvironment
for attaching extra information to the environment instance - Updated docs to consider Relay server specifications GraphQL best practices and not purely a Relay spec: #2603
- https://relay.dev has a new landing page redesign: #2953
Experimental
- Data Invalidation: Added new Data Invalidation primitives to allow marking data in the Relay Store as stale. When data is marked as stale, queries that reference that data will also be stale; stale queries will indicate to Relay that they need to be refetched the next time they are evaluated.
- Deprecate
LazyLoadEntryPointContainer
=>LazyLoadEntryPointContainer_DEPRECATED
: 08bde91 - Removed Unused types from RelayStoreTypes 76354e9
usePreloadedQuery
now takes an unstableUNSTABLE_renderPolicy
likeuseLazyLoadQuery
: fc1b88buseMutation
Hook was added: 96d9703- Export a
JSResource
Flow interface from Relay. - Fixed subscribing to plural fragments with missing data when using
useFragment
.