8.0.0
Commits: v7.1.0...v8.0.0
Breaking
- Relay Compiler no longer relies on the
graphql-jsschema 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-jsmay 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,parseLiteralandserializethat can be defined for a graphql type viagraphql-jsprimitives 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 usingcreateOperationDescriptoravailable inrelay-runtime`.
Added
- Allow language plugin to add schema extensions. #2935
- In
relay-compilerwe added support for variables in complex objects and arrays: 5da3be0 isClientIDhelper is available to use inrelay-runtimedac614c
Fixed
-
Remove the
clientMutationIdrequirement by creating a new root id for each executed mutation: #2349 -
validateMutationcorrectly handles lists of scalar fields in the optimistic payloads: 56795ba -
DissalowIDAsAliasthis validation had a bug, there it wasn't traversing LinkedFields, hence wasn't reporting violations in their selections. c4547f9 -
RelayModernFragmentSpecResolveronly 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
optionsproperty onIEnvironmentfor 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
usePreloadedQuerynow takes an unstableUNSTABLE_renderPolicylikeuseLazyLoadQuery: fc1b88buseMutationHook was added: 96d9703- Export a
JSResourceFlow interface from Relay. - Fixed subscribing to plural fragments with missing data when using
useFragment.