NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #3933 most downloaded on npm
A core runtime for building GraphQL-driven applications.
Last release 3 days ago
01 Oct 2026
Ships on a steady schedule
a new release about every 9 days
Nearly every release is documented
notes for 54 of 55 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
4314 releases · first in 2017
Feat: Warn on deprecated enum values used as arguments ( #5277 ) by jungwoo3490 ( commit )
Version 21.0.0 had an issue where it failed to include our new TypeScript types in the published NPM bundle. Thanks to @PHILLIPS71 for the pull request identifying and resolving the issue. This point release resolves that issue and includes a number of other minor improvements which have landed since to v21.0.0 release.
shard_extra_artifacts feature flag to shard PHP text artifacts by Tianyu Yao (commit)One column per quarter.
Upgrade minimatch to 3.1.4 to fix CVE-2026-27903 /27904 ( commit )
Relay v21.0.0 brings first-party TypeScript support, modernized Flow type generation, new error handling capabilities, and experimental React Server Components support. This release contains several breaking changes -- please read the migration notes below carefully.
TypeScript users: First-party .d.ts type definitions are now shipped directly in relay-runtime and react-relay. You no longer need @types/relay-runtime from DefinitelyTyped. Node.js ESM named imports (e.g. import { fetchQuery } from 'relay-runtime') now work correctly in .mjs files. Thank you to everyone who contributed to the DefinitelyTyped type definitions over the years — your work kept the Relay TypeScript community going, and it served as a valuable reference for these first-party types.
Flow users -- action required: Generated types now use modern Flow syntax. (expr: Type) casts are replaced with (expr as Type) (requires Flow >= 0.250.0), $ReadOnlyArray becomes ReadonlyArray, mixed becomes unknown, and $NonMaybeType becomes NonNullable. After upgrading, you must re-run the Relay compiler to regenerate all artifacts.
@live_query removed: The @live_query directive has been removed. Migrate to @client_polling(interval: ...) for polling behavior, or @live for server-pushed updates.
Relay Resolvers -- new syntax required: The enable_legacy_verbose_resolver_syntax flag has been removed. The legacy verbose docblock syntax (@onType, @onInterface, @fieldName, @edgeTo) no longer works. In addition, we've replaced the generic @RelayResolver tag with more specific @relayField and @relayType tags. The Relay compiler can automatically migrate you to this new syntax via the relay-compiler codemod fix-all command. If you're not ready to migrate, you can enable the allow_legacy_relay_resolver_tag feature flag in your compiler config file.
@oneOf inputs: @oneOf input types now generate a stricter discriminated union type that only permits one property at a time, instead of an object with all optional fields. This catches bugs at compile time where multiple fields were incorrectly set simultaneously. You can opt out via oneOfType: "relaxed" in compiler config if needed.
@catch expansion: @catch now works on @connection fields and client edge fields, letting you gracefully handle field errors in pagination and client-edge scenarios instead of throwing.
@alias on fragment definitions: The @alias directive now works on fragment definitions (not just inline fragments).
New compiler CLI tools: Two experimental subcommands are available: experimental-regenerate-sub-schema replaces the currently configured schema file with the portion of the provided "full schema" and experimental-compare-document-ir compares intermediate representations (IR) of documents passed and outputs selections that exists in left but not in right.
React Server Components (Experimental): A new react-relay/rsc_EXPERIMENTAL entry point provides an experimental API for fetching GraphQL in server components: serverFetchQuery for server-side data fetching, serverReadFragment for reading fragment data on the server, and serverPreloadQuery + useQueryFromServer for preloading data on the server and hydrating the client store. These APIs are experimental and are likely to change in upcoming versions.
@raw_response_type accuracy: Selections on abstract types in @raw_response_type are now correctly typed as optional when the concrete type may not implement the abstract type (PR #4775).@match fields: The compiler now properly validates and reports errors for conflicting @match fields across fragments, preventing silent runtime issues.--watch mode, including cross-project fragment crash resolution and proper detection of schema field changes.mixed to unknown (commit)query-stats subcommand for per-operation fragment usage analysis (commit)<Activity> a->b->a mutation edge case (commit)extend X { ... } instead of X { ... } (commit)react-prefer-namespace-import ESLint Rule (commit)requireCond (commit)pretty crate for document-based formatting (commit)set_remove_defined_references to remove Set contents from a given exclusionary schema (commit)arc lint --take PRETTIERJAVASCRIPT (commit)$Values to Values (commit)mixed to unknown in xplat/js (commit)$NonMaybeType) to TypeScript-style types in xplat/js (commit)$ReadOnlySet (commit)Note truncated.
This patch release reverts the change that disabled persisted queries in validate mode (added in #5013 ) as it was breaking the --validate command. Th
This patch release reverts the change that disabled persisted queries in validate mode (added in #5013) as it was breaking the --validate command. The release also contains a bug fix for GraphQL payloads without a prototype and a of couple docs improvements.
Stop picking up config_id in @LiVe Relay by Xiangxin Sun ( commit )
@alias docs. by Jordan Eldredge ([commit](f933d6c065c7))variables arg in fetchQuery NoInfer to improve errors by Sam Zhou ([commit](6314d78f67a5))variables prop in useLazyLoadQuery NoInfer to improve errors by Sam Zhou ([commit](11932da30a1b))variables prop in commitMutation param NoInfer to improve errors by Sam Zhou ([commit](333073191bb6))@relay_test_operation operations (#4999) by Jakob Hansen ([commit](332053295031))This release includes a number of compatibility updates and removes a couple of deprecated rules. For more info, see the eslint-plugin-relay changelog…
Relay's ESLint plugin, eslint-plugin-relay, was recently updated to v2.0.0. This release includes a number of compatibility updates and removes a couple of deprecated rules. For more info, see the eslint-plugin-relay changelog.
This release includes a brand new page covering the Relay compiler config. This has largely been undocumented so far and now includes autogenerated documentation! We also added tooling to autogenerate API docs from source code. The documentation for useRelayEnvironment and useLazyLoadQuery are examples of the new autogenerated tooling.
@outputType directive, these must be migrated to be strong or weak objects. You can continue to use the @outputType directive by enabling the allow_output_type_resolvers feature flag in the compiler config. (#5004) by Jordan Eldredge (commit)useRelayEnvironment by Tianyu Yao (commit)Parse the @gqlField docblock for the description and deprecated tag by Evan Yeung ( commit )
Relay 19.0.0 includes many documementation improvements, bug fixes, and improved capabilities.
@alias required on conditional fragmentsTo improve type safety, the @alias directive is now required on all fragments that are only conditionally fetched either due to @skip/@include or fragment type conditions which only conditionally match. You can opt out of this validation on a per-fragment basis with the @dangerously_unaliased_fixme directive.
To enable incremental migration we include a codemod which will automatically add the @dangerously_unaliased_fixme in all required places:
npx relay-compiler codemod mark-dangerous-conditional-fragment-spreadsYou can also opt out of this validation entirely via compiler config feature flag:
{
// ...
"featureFlags": {
"enforce_fragment_alias_where_ambiguous": {
"kind": "disabled"
}
}
}We've merged ~30 commits to clean up and improve our docs since the last release:
React 19 is now a valid peer dependency of Relay (#4944) by Krzysztof Karol (commit)
"eagerEsModules": false in your relay.config.json to opt back into the old behavior. (commit)schemaExtensions to Support Both Files and Directories (#4859) by Sverre Johansen (commit)observeFragment() (#4862) by Iha Shin (commit)readFragment export in relay-runtime (#4931) by Jay Jaeho Lee (commit)observeFragment triggering unhandled rejections on network error (#4885) by Iha Shin (commit)Updating Data section of relay docs by Lynn Yu (commit)@module will only work if each fragment is on a different concrete type by Lynn Yu (commit)[4360f69]: Deprecate GK relay_enable_load_query_request_deduping by Nithik Balachandran
Relay version 18.2.0 comes with several bug fixes and improvements!
Codemods are tools which enable you to programmatically update your code. These are especially helpful if you want to upgrade an API across your whole codebase without needing to manually change each call site. The Relay compiler, with its understanding of your GraphQL snippets, is well positioned to help with these kinds of tasks. In Relay 18.2.0 we are introducing Relay Codemods.
We currently support two different codemods:
mark-dangerous-conditional-fragment-spreads marks places where @alias is required to make a fragment spread safe. This can enable you to turn on the enforce_fragment_alias_where_ambiguous feature flag. Learn more in the @alias docs.remove-unnecessary-required-directives identifies places where @required is unnecessary because it's used on a non-nullable field within a fragment or query that is @throwOnFieldError, and removes the @required directive.We are looking forward to helping Relay users with more codemods in the future!
It is often possible to speed up list pagination by pre-loading one or more pages of results ahead of what the user is currently viewing. Our previous APIs made this difficult to fetch the next page of data without also rendering it at the same time. We are currently exploring an experimental API to make it easy to manage paginated lists with prefetching.
Read more in the docs: usePrefetchableForwardPaginationFragment
The @catch directive can now be used on fragments, queries, mutations and aliased inline fragments. This enables more flexibility in controlling how field errors are handled.
@alias enforcement by Jordan EldredgeFollowing up from our v18.0.0 release last month, v18.1.0 provides a number of fixes and improvements, adds some new experimental APIs, and ships some
Following up from our v18.0.0 release last month, v18.1.0 provides a number of fixes and improvements, adds some new experimental APIs, and ships some long-running experimental features as stable.
For the past several years we've been iterating on Relay Resolvers which provided a structured and typesafe way to model client state and derived data in your GraphQL graph. As of this release, Relay Resolvers are enabled by default and no-longer experimental. As part of this stabilization we shipped fixes for Relay Resolvers when used with TypeScript and fixed a few edge cases related to how errors encountered by resolvers are handled.
We released @catch in v18.0.0 and are very excited about the capabilities it enables. Check out Itamar Kestenbaum's GraphQL conf talk about it here: Build Confidently: How @Catch and Error Handling Pave Way in Field Nullability.
Since that release we've made a few improvements:
@catch directive that are marked as @semanticNonNull in the schema now generate non-nullable TypeScript/Flow types. See semantic nullability.@catch no-longer include the error message. This is because GraphQL error messages are generally not safe to show to users. These error messages can still be accessed by the field logger provided to your Relay Environment. In the future we plan to let users opt into allowing safe error messages through to product code.We've improved how errors are reported by the Relay compiler to ensure we report as many errors as possible, and each error includes sufficient context.
Our VSCode extension now includes a command to quickly copy the full text of a query directly from within your editor.
In some cases it can be useful to read a fragment outside of a React hook. However, doing this requires handling a number of concerns.
@defer or Relay Resolver suspense).@throwOnFieldError, @required(action: THROW))To enable users to read fragment data while correctly handling these cases, we've added two experimental APIs:
observeFragment: Read a fragment as a stream of states where each state might be loading, error, or value.waitForFragmentData: Read a fragment as a promise which will resolve when data is available, or reject if an error is encountered.Thanks to members of our community for submitting pull requests to improve our docs:
We are always continuing to evolve and improve Relay. These changes are part of features or implementations which are either in progress or are being experimented with internally.
[d3afbb]: Support @deprecated annotation by Lynn Yu
With version 18, the Relay team at Meta and our community of contributors have made several significant improvements to Relay:
@alias released as stable@catch to detect and granularly handle field errors@throwOnFieldError and @semanticNonNull to avoid having to handle the nullability of fields which are only null in the case of error.Read all about them in more detail below:
Previously we were not correctly type-checking arguments passed to client-defined fields, such as Relay Resolvers and Client Schema Extensions. This new release adds that validation. If you need to opt out of this validation for any reason, you can enable the disable_full_argument_type_validation compiler feature flag.
{
// ... rest of config
"featureFlags": {
"disable_full_argument_type_validation": {
"kind": "enabled"
}
}
}
Aliased fragments are a Relay feature that lets you access fragments spreads and inline fragments as named properties. This can be especially helpful for fragments which might be conditionally fetched due to @skip/@include or type conditions which might not match. With @alias these fragments get typed as nullable properties allowing you to check at runtime if they've matched or not before trying to use the data.
@catch, enabled by default will let you check at runtime if a field errored. This can allow you to disambiguate between true nulls returned by your server, and fields which are null due to field level errors.
@throwOnFieldError can be added to fragments and queries and will cause any field errors within that fragment/query to throw when read. This ensures that all null values you encounter are true nulls as returned by your field resolvers on the server, and not field level errors that have been coerced to null.
Read more about @throwOnFieldError
@throwOnFieldError unlocks a powerful new feature when combined with a schema that has fields annotated with @semanticNonNull. @semanticNonNull can be added to fields which have been made nullable in the schema only to enable more robust error handling, but are not expected to return null expect in the case of errors.
Within fragments or queries annotated with @throwOnFieldError, fields annotated with @semanticNonNull will be typed as non-nullable. This has the potential to dramatically reduce the number of null checks you need to perform inside your product code, while also making your product code more "correct" by treating all field errors as explicit errors.
Read more about Semantic Nullability
Thanks for Mark Polak and Drew Atkinson from Microsoft, Relay Resolvers can now be configured to accept a shared context object, similar to standard GraphQL resolvers.
Read more about Resolver context
Thanks also to for Mark Polak from Microsoft, the Relay compiler config now supports the option "noSourceControl": true which will ask the Relay compiler to not automatically try to add/remove files from Git or Mercurial.
Thanks to Tobias Tengler, Relay's editor support now includes:
IdOf by Tianyu YaoThere were over 100 additional commits since our last release which have been omitted from this doc
Since our last release in January of this year, we've made many improvements to Relay. Themes include:
Since our last release in January of this year, we've made many improvements to Relay. Themes include:
Relay compiler now runs spec-compliant schema validation against your schema including client schema extensions and Relay Resolvers. You can opt out of this feature by disabling validation in your Relay compiler config.
// relay.config.json
{
//...
"featureFlags": {
"disable_schema_validation": true
}
}
[ccc4465e6a47] by Jordan Eldredge
We now validate that the names passed to directives like @prependNode and @appendNode are valid typenames. You can opt out of this validation with the following feature flag in your compiler config:
// relay.config.json
{
//...
"featureFlags": {
"disable_edge_type_name_validation_on_declerative_connection_directives": {
"kind": "enabled"
}
}
}
[53b24361bb4d] by tobias-tengler
This release includes a new implementation of our hooks which are significantly more efficient in terms of memory use. Thanks to Dave McCabe for his work on this huge project.
Huge shout out to community contributor Tobias Tengler for many improvements to our Editor Support via our VSCode extension. Our VSCode extension is powered by the relay-compiler so upgrading to version 17.0.0 of the compiler should unlock a number of great IDE features.
watchman_query_time_before_subscribe by Tianyu Yaowatchman_query_time_before_subscribe by Tianyu YaopreferFetchable argument to the @refetchable directive by Andrey Lunyovnode query generation in @refetchable by Andrey LunyovpreferFetchable argument by Andrey LunyovReactTestUtils by Tim YungWe are also continuing to evolve many experimental features which are not yet stable enough to be enabled by default in Relay.
Relay Resolvers have been extended to support defining types which implement interfaces, and define resolvers that return client-defined interfaces where all implementing types are defined using Relay Resolvers. Relay Resolvers are now stable enough to have full documentation with instructions on how to enable them.
IdOf<> return type by Tianyu YaoWe've added an experimental new directive to allow fragments to appear as fields. This can enable you, or optionally require you, to check if a fragment was fetched before using it.
As part of our involvement with the GraphQL Nullability Working Group we are exploring features to enable explicit error handling and semantic nullability. Neither of these features are officially available yet, but we're excited about what will become possible here.
This change is a breaking change, as the customScalars config option in the single-project config must now be specified as customScalarTypes.
This change is a breaking change, as the customScalars config option in the single-project config must now be specified as customScalarTypes.
Parameters and indexed access type to extract PreloadParams by Sam Zhoudirectives argument for @refetchable (#4520) by Daniel Lo NigroFull Changelog: https://github.com/facebook/relay/compare/v16.1.0...v16.2.0
[930864a33ede]: Deprecate verbose resolver syntax with feature flag to enable by Jordan Eldredge
enable_strict_custom_scalars to perform validations when custom scalar types are used, to check that the user doesn't try to pass literal values (strings, ints, etc) in positions where a custom scalar type is expected, as this can break type safety since Relay can't know whether those literals conform to the underlying custom type.EntryPointElementConfig by Sam ZhouuseFragmentInternal to use in useLazyLoadQueryNode by Andrey LunyovTypeScript-related breaking changes:
@connection directive will now throw if they are invalid instead of being a no-op. [2dd79543d3f6]Flow-related breaking changes:
commitMutation [603ce546741a] and useMutation [051e4694c20b].RelayModernRecord.js. [21a896c54e63]babel-plugin-syntax-hermes-parser plugin, which switches Babel to use hermes-parser instead of @babel/parser, and enables full syntax support for Flow. [c320a892482c]React.Element fully opaqueTypeScript-related breaking changes:
Record<PropertyKey, never> instead of as {} to represent an object without properties. [16910c948e9a] (#4404)null and undefined (T | null | undefined) instead of (T | null). To keep the old type generation behavior for now, you may set the typescriptExcludeUndefinedFromNullableUnion feature flag in the relay-compiler config as follows. ~Note the feature flag will be removed in a future release~. [cc47bc95414b] (#4380)
{
"language": "typescript",
"typescriptExcludeUndefinedFromNullableUnion": true
}
Relay Resolvers are an experimental feature of Relay which allows you to model derived data, and soon client state, in your Relay graph. Since our last release we’ve put considerable work into stabilizing the feature. This includes bug fixes across our compiler, type generation, runtime and LSP (editor integration). In particular, contributors have fixed a number of bugs which made it impossible to use Relay Resolvers with TypeScript.
Documentation:
Improvements:
@required to bubble to client edge resolvers.@live field@weak resolver values were getting normalized@weak model resolvers@rootFragment on model types@rootFragment on model types@required on client edges@defer/@stream names (#4467)Additions:
Typo fixes:
useTransistiongetting-started/installation-and-setup.md (#4306)Tutorial updates:
Other corrections:
readInlineData function (#4451)useMemo() in docs (#4281)cannotReadPropertyOfUndefinedexperimental.abstract_locations configinference_mode config now that LTI is the defaultTPreloadParams invariant$Shape to Partial in Relay files, suppressing errors[50266e1051c9] Warn on deprecated field and directive args
Record (which is an untyped grabbag containing whatever the store has), we instead pass a ?ReadOnlyRecordProxy. Furthermore, we replace NormalizationLinkedField with CommonLinkedField, which both a ReaderLinkedField and NormalizationLinkedField "implement".flow for graphql tags. [a75a445bb72c] [ef29f061fd3a] [78bd12d39562] [614c74718544] [ab9f04ab54ea]@weak objects@weak types in docblocksimport type for named imports in typescriptimport type in typescript for all imports (#4029)assignClientAbstractTypes to the DataCheckerjs fields in query for 3D when local import is enabledRelay v14.1.0 adds improvements for existing relay features - primarily fixes and feature compatibility for client extensions and @inline. Thanks to o
Relay v14.1.0 adds improvements for existing relay features - primarily fixes and feature compatibility for client extensions and @inline. Thanks to our open source contributors who helped us release the Relay VSCode Extension!
[cefab9e1659f] Support for @required and client-edges
[90ccda1da4b0] Support @argumentDefinitions in @inline fragments (#3935)
[8adcfab3ec11] VS Code: Find references of the Resolver field.
[b965299349d1] useClientQuery hook
[7d5cc3431891] Add support for resolvers without fragments
[8db002fa4120] Support custom scalar arguments that are passed as literals
[a5d67d6bf677] Add resolvers to the dependency graph (Fix missing resolver fragments in incrmental mode and VS Code)
[57f96a133177] Improve error message when you mix up @live and non-live values.
[c4dbd26278fa] Remove .js and .ts from require / import (#4002)
[cd1e9ae06d11] Fix MutationHandlers on field with args
[7e6dbdd6af74] Ensure only one implemntation on interface
[055908fb12a2] VS Code: Fix comment blocks to recognize the embedded language inside of a JS file. (#4001)
[6a9b0e560e3d] Performance optimizations in the validate_conflicting_selections
[fa5a3baa9a8d] Explicitly enumerate unsupported ReaderNode types
[9990e6f0bf79] Disallow default values on resolver fields
[d42bb7c5a139] VSCode extension pathToRelay doesn't allow relative paths (#3969)
[a86323f43c59] Validate conflicting selections in client fields
[739009f649cd] remove DEPRECATED_GraphQLSubscriptionConfig type.
src, schema, artifactDirectory. This simplifies the public API of the compiler. The error message should print helpful message with possible config file, that can be used instead of these CLI arguments.language configuration option required. In v13, we have default language as flow (or Javascript with Flow comments) for reading and generating artifacts. Majority of the projects in OSS, however, use typescript - in order to detect which language (typescript, JS, or flow) is used in the project we will use this option.__typename in fragments on query.__typename selections within concrete linked fields have a string literal type, instead of the type string.typegen_phase have been removed from the Relay compiler config.readUpdatableQuery_EXPERIMENTAL and readUpdatableFragment_EXPERIMENTAL@inline fragments (#3933).@no_inline (#3923).CustomScalarType to represent custom scalar types in the Relay compiler configuration.sha256 and md5 for local file persister (#3878)@required on plural fragments.@inline fragments.graphql tag and template. literal.Full Changelog: https://github.com/facebook/relay/compare/v13.2.0...v14.0.0
[bdbc736710a] Allow marking Relay Resolvers as deprecated
https://github.com/facebook/relay/compare/v13.1.1...v13.2.0
[b23570e3552] Restore live query in non fb_only
typegenPhase in the single project config file. See release v13.1.0 for more details.Full Changelog: https://github.com/facebook/relay/compare/v13.1.0...v13.1.1
[0ad48b395ef6b2163c73f4c48da5e7e18f359ada] removes old aliases in generated files by default. This can be restored temporarily with the compiler confi
"flowTypegen": "Compat" but projects should migrate to using the updated names (e.g. MyFragment$fragmentType instead of MyFragment$ref.https://github.com/facebook/relay/compare/v13.0.3...v13.1.0
[052cf7283cb] [e2888b9c0dc] Documentation Improvements
__isX fieldsIgnore. To keep some files in __generated__ (or in artifactDirectory) directoriesworker_count from the OperationPersister interfacecommon/rust/cargo_from_buck/bin/autocargodetail fieldFull Changelog: https://github.com/facebook/relay/compare/v13.0.2...v13.0.3
[2cdc4240636] Enum changes are breaking changes
global before usage (#3646)import instead of require if eager_es_modules = true---validate CLI option (#3771)persistConfig.paramsid field name from schema_config in relay-typegennpx prettier on README filesrelay-compilercommon/rust/cargo_from_buck/bin/autocargo@waterfall directive@waterfall to Client Edge fields@requiredwithin Resolvers@required resolver values@required for Relay ResolversThank you to all contributors who helped with this release! Special thanks to @ch1ffa for adding many valuable fixes and improvements!
Full Changelog: https://github.com/facebook/relay/compare/v13.0.1...v13.0.2
[4fd06d12a26] Add repersist cli flag (#3722).
extensions in config.Full Changelog: https://github.com/facebook/relay/compare/v13.0.0...v13.0.1
Breaking changes in the new Relay compiler
relay-compiler is now implemented in Rust and it replaced the JS version from v12.
LOG, THROW, or bubble (NONE) null fields.flow for graphql tags. It may break some of the components that rely on the structure of the generated Relay flow-types.commitLocalUpdate; it is now derived from the shape of the mutation and is optional. This type had previously been typed as $FlowFixMe (i.e. any); as a result, adding static types here is a breaking change.relay-config.For more details see:
Changes since RC.2
Node interface id field to be configurable. (#3638)include option to single project config file, and warn if it is used.* * To install this version, run:
To install this version, run:
npm install react-relay@dev relay-runtime@dev
npm install --save-dev relay-compiler@dev babel-plugin-relay@dev
Or using yarn:
yarn add relay-runtime@dev react-relay@dev
yarn add --dev relay-compiler@dev babel-plugin-relay@dev
main to NPM (#3709)connection_interface on the project_configProjectConfig and some other things to relay-configTypesafe Updaters: Add support for client schema extension fields. Typesafe updaters is an unreleased, experimental project to provide a more ergonomic, typesafe interface for writing updaters.
` npm install react-relay@dev relay-runtime@dev npm install --save-dev relay-compiler@dev babel-plugin-relay@dev `
To install this version, run:
npm install react-relay@dev relay-runtime@dev
npm install --save-dev relay-compiler@dev babel-plugin-relay@dev
Or using yarn:
yarn add relay-runtime@dev react-relay@dev
yarn add --dev relay-compiler@dev babel-plugin-relay@dev
artifactsDirectory (#3675) [bc03126af3a]relay-config (#3678) [4c5ddec8f3d]Breaking changes in the new Relay compiler
The one with compiler implemented in Rust.
For reference, see the issue: https://github.com/facebook/relay/issues/3180
To install this version, run:
npm install react-relay@dev relay-runtime@dev
npm install --save-dev relay-compiler@dev babel-plugin-relay@dev
Or using yarn:
yarn add relay-runtime@dev react-relay@dev
yarn add --dev relay-compiler@dev babel-plugin-relay@dev
relay-compiler is now implemented in Rust and it replaced the JS version from v12.
@required directive: Improve the ergonomics of handling null values by declaratively telling Relay to either LOG, THROW, or bubble (NONE) null fields. See more: https://relay.dev/docs/next/guides/required-directive/@no_inline: Disable inlining the fragment when it is used in normalization(query) artifacts. Reduce generated artifacts size if the fragment is used in many places.flow for graphql tags.
ReaderInlineDataFragment to GraphQLTaggedNodecommitLocalUpdate; it is now derived from the shape of the mutation and is optional. This type had previously been typed as $FlowFixMe (i.e. any); as a result, adding static types here is a breaking change.
@required docs publicreadUpdatableQuery_EXPERIMENTAL method which allows developers to update data in the store using regular assignment, instead of the existing store mutation APIs.Full Changelog: https://github.com/facebook/relay/compare/v12.0.0...v13.0.0-rc.0
It also contains a few small, but possibly, breaking changes. One of which is related to the Abstract Type Refinement, others to the live query behavi…
Commits: https://github.com/facebook/relay/compare/v11.0.2...main
This is release contains a long list of new fixes and additions to Relay that was added in the last few months: runtime optimizations, react integration updates, logger updates, internal type-safety, documentation updates, and more.
It also contains a few small, but possibly, breaking changes. One of which is related to the Abstract Type Refinement, others to the live query behavior.
The Relay team is continuing work on the new rust-version of the compiler, and VS Code extension. As well as experimenting with the new features: multi-environment runtime support, advanced client-state management APIs. We hope to include these in the upcoming releases.
Thanks to all contributors for your work and support!
false by default, but true in internal configuration [2732db54335].getPaginationMetadata, getPaginationVariables, getRefetchMetadata, getValueAtPath, type Direction [3b6f70d85fb]._processModuleImportPayload.falsy conditions and @skip.environment.lookup when not needed in QueryResource.applyMutation.lodash from 4.17.20 to 4.17.21 in /packages/babel-plugin-relay (#3482).path-parse from 1.0.6 to 1.0.7 in /packages/babel-plugin-relay (#3559).Add Relay CodeSandbox to website [f71d1e2261]
areEqual{OSS => ArgValues} [b8d2694dbe]fbjs/lib/ErrorUtils Dependency [5ed076ee7a]fbjs/lib/invariant with invariant (#3448) [3982f9dca4]Fixed several broken website redirects
This release contains a set of updates to the new Relay website. Some of the PRs are listed here explicitly. Thank you for your contributions.
preloadQuery with loadQuery (#3412)<p> (#3385)New version of `fetchQuery` added. See description in Breaking Changes.
For our announcement on Relay Hooks, check out our blog posts on relay.dev and Facebook Open Source. For docs, see our updated docs website at relay.dev/docs, and for an update on our upcoming releases, see this issue.
fetchQuery:
fetchQuery now returns a lazy Observable which you can subscribe to. It will perform in-flight request de-duping of identical requests. Ignores any Network Layercaching by default, but supports a [fetchPolicy](https://relay.dev/docs/en/experimental/a-guided-tour-of-relay#fetch-policies) to check data cached in the Relay Store.fetchQuery renamed to **** fetchQuery_DEPRECATED. Previous behavior returns a Promise (can’t be observed). No request de-duping.react-relay: fetchQuery exported from react-relay now has updated behavior and function signature. To access previous version of fetchQuery, import fetchQuery_DEPRECATED from react-relay or react-relay/legacy.relay-runtime: fetchQuery exported from relay-runtime now has updated behavior and function signature. To access previous version of fetchQuery, import fetchQuery_DEPRECATED from relay-runtime.getDataID was renamed from UNSTABLE_DO_NOT_USE_getDataID. This config option is now stable. It can be passed to the Relay Environment and Relay Store as an option that will be used to compute the Data ID for the given record.gcReleaseBufferSize is now 10 (previously 0).
QueryRenderer or useLazyLoadQuery), Relay will temporarily retain the query in the “release buffer” until the buffer is full. With a buffer size of 0, released queries would not go into the buffer and would be immediately removed from the store cache.store-or-network. to actually reuse cached data when navigating back to previously visited views.UNSTABLE_renderPolicy is now always “partial”. We don’t expect this to produce any issues, and will only affect you if you are upgrading from an experimental release. This option can still be configured, but we will completely remove it in the upcoming releases.react-relay and react-relay/hooks. See this issue for more details.
relay-experimental has been removed from the source code, and no new experimental builds will be published to npm.fetchQuery added. See description in Breaking Changes.ConnectionHandler.getConnectionID to make it easier to get a connection ID for usage in updaters or declarative connection mutations (@kyarik: https://github.com/facebook/relay/pull/3332)loadQuery accepts a fetchPolicy of 'store-only'loadQuery now warns, instead of throwing, if called during the render phase.getDataID is now a stable config option. See description in Breaking Changes.gcReleaseBufferSize is now 10. See description in Breaking Changes.ConnectionHandler will no longer create edges with an undefined cursor field. This also applies to edges created via @appendNode or @prependNode. (https://github.com/facebook/relay/pull/3278)graphql with Rust Compiler.loadQuery is called and no network request is made (i.e. if the data is available in the store and the fetch policy allows it), the query is retained in the environment.loadQuery now includes the network cache config in the operation descriptor that is executed against the environment.New version of `fetchQuery` added. See description in Breaking Changes.
To install, run:
npm install react-relay@dev relay-runtime@dev
npm install relay-compiler@dev babel-plugin-relay@dev --dev
See this issue for more details on upcoming releases. We will publish our updated docs and website with the next stable release, along with additional external communications with the community.
The new docs will be more comprehensive, and are still are ongoing updates. In the meantime, in order to access some documentation for the APIs in this RC, you can access our current experimental docs, or manually build the docs in website-v2.
fetchQuery:
fetchQuery now returns a lazy Observable which you can subscribe to. It will perform in-flight request de-duping of identical requests. Ignores any Network Layer caching by default, but supports a fetchPolicy to check data cached in the Relay Store.fetchQuery renamed to fetchQuery_DEPRECATED. Previous behavior returns a Promise (can’t be observed). No request de-duping.react-relay: fetchQuery exported from react-relay now has updated behavior and function signature. To access previous version of fetchQuery, import fetchQuery_DEPRECATED from react-relay or react-relay/legacy.relay-runtime: fetchQuery exported from relay-runtime now has updated behavior and function signature. To access previous version of fetchQuery, import fetchQuery_DEPRECATED from relay-runtime.getDataID was renamed from UNSTABLE_DO_NOT_USE_getDataID. This config option is now stable. It can be passed to the Relay Environment and Relay Store as an option that will be used to compute the Data ID for the given record.gcReleaseBufferSize is now 10 (previously 0).
QueryRenderer or useLazyLoadQuery), Relay will temporarily retain the query in the “release buffer” until the buffer is full. With a buffer size of 0, released queries would not go into the buffer and would be immediately removed from the store cache.store-or-network to actually reuse cached data when navigating back to previously visited views.UNSTABLE_renderPolicy is now always “partial”. We don’t expect this to produce any issues, and will only affect you if you are upgrading from an experimental release. This option can still be configured, but we will completely remove it in the upcoming stable release.react-relay and react-relay/hooks. See this issue for more details.
relay-experimental has been removed from the source code, and no new experimental builds will be published to npm.fetchQuery added. See description in Breaking Changes.ConnectionHandler.getConnectionID to make it easier to get a connection ID for usage in updaters or declarative connection mutations (@kyarik: https://github.com/facebook/relay/pull/3332)loadQuery accepts a fetchPolicy of 'store-only'loadQuery now warns, instead of throwing, if called during the render phase.getDataID is now a stable config option. See description in Breaking Changes.gcReleaseBufferSize is now 10. See description in Breaking Changes.ConnectionHandler will no longer create edges with an undefined cursor field. This also applies to edges created via @appendNode or @prependNode. (https://github.com/facebook/relay/pull/3278)graphql with Rust Compiler.loadQuery is called and no network request is made (i.e. if the data is available in the store and the fetch policy allows it), the query is retained in the environment.loadQuery now includes the network cache config in the operation descriptor that is executed against the environment.Improve testing documentation grammar
Avoid throwing in the DeclarativeMutationHandler when the server returns null [9d31dfbd5]
null [9d31dfbd5]Mark failed network requests on preloaded query references
Added @appendNode and @prependNode declarative mutation directives for inserting a node to connections (#3155) [0fe732dab]
@appendNode and @prependNode declarative mutation directives for inserting a node to connections (#3155) [0fe732dab]
comments @appendNode(connections: $connections, edgeTypeName: "CommentEdgeType") { id }@deleteEdge directive for removing the edge from connections (#3177) [01d65b3]
deletedCommentId @deleteEdge(connections: $connections)@deleteRecord directive (#3135) [27f938c2a]
deletedCommentIds @deleteRecord^16.9.0 || ^17 as a peerDependency.loadQuery API.useQueryLoader now accepts an initial query reference.usePreloadedQuery from consuming stale cached query refsThe Relay team is actively working on the new compiler implemented in Rust. The majority of recent changes you can see in the repo are related to the compiler. This new version won't be included in the release, as we are still working on the migration strategies for our OSS customers.
Thank you for all outstanding contribution to the Relay compiler (https://github.com/facebook/relay/pull/3182)
Remove persisted query id invariant from loadQuery
prepareEntryPoint returns void and is deprecated
type from the schema (b63815b82)label arg from @stream_connection (2e2be4cac)onLoad support to PreloadableQueryRegistry (8242adca0)Add option in Environment to handle stripped nulls in payload by leoasis@gmail.com, 2020-04-21
handler arg in @connection validation by jstejada@fb.com, 2020-03-09 (62a10d806)extraOptions field. by efaust@fb.com, 2020-02-12 (2b8697733)Rename getModernOperationVariables to getOperationVariables
getModernOperationVariables to getOperationVariablesqueuePendingOperation to RelayModernMockEnvironment in testing tools. This allows the caller to manually register an operation that should be pending.graphql strings (https://github.com/facebook/relay/pull/2811).DataChecker::check now returns the operation fetch time.getRelayDefaultMissingFieldHandlers.js@stream’ed responses.useLegacyPaginationFragment to usePaginationFragment.preloadQuery will error if called during render.@streaming or @defer.Deprecate LazyLoadEntryPointContainer => LazyLoadEntryPointContainer_DEPRECATED: https://github.com/facebook/relay/commit/08bde918325336bdaacb444b249e…
Commits: https://github.com/facebook/relay/compare/v7.1.0...v8.0.0
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 the graphql-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 function parseValue, parseLiteral and serialize that can be defined for a graphql type via graphql-js primitives are not accessible in the relay compiler: this may break serialization of custom scalars. https://github.com/facebook/relay/commit/860c23cbb445e04fd14e5d05ed53a026d4f63357store.getRoot. Usages like store.getRoot().getLinkedRecord('create_comment_mutation') will break.RelayRecordSourceProxy::commitPayload(). Note that this method was not part of the public interface.RelayStore.retain() changed to directly accept an OperationDescriptor. An operation descriptor to pass to RelayStore.retain()can be constructed usingcreateOperationDescriptoravailable inrelay-runtime`.relay-compiler we added support for variables in complex objects and arrays: https://github.com/facebook/relay/commit/5da3be070283c6dcd42774ba33c1590db65fe3c7isClientID helper is available to use in relay-runtime https://github.com/facebook/relay/commit/dac614c4812fc48db9c00d69d81dc1aa0c6231dbRemove the clientMutationId requirement by creating a new root id for each executed mutation: https://github.com/facebook/relay/pull/2349
validateMutation correctly handles lists of scalar fields in the optimistic payloads: https://github.com/facebook/relay/commit/56795ba6f839e4d770d19b0d921940515db98475
DissalowIDAsAlias this validation had a bug, there it wasn't traversing LinkedFields, hence wasn't reporting violations in their selections. https://github.com/facebook/relay/commit/c4547f9a0fd41c28851490d2ba499e0f30831175
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: https://github.com/facebook/relay/pull/2960
options property on IEnvironment for attaching extra information to the environment instanceLazyLoadEntryPointContainer => LazyLoadEntryPointContainer_DEPRECATED: https://github.com/facebook/relay/commit/08bde918325336bdaacb444b249ed1dd5a81d30cusePreloadedQuery now takes an unstable UNSTABLE_renderPolicy like useLazyLoadQuery: https://github.com/facebook/relay/commit/fc1b88b9cd59b646444562c8c597308c8cb9f8cduseMutation Hook was added: https://github.com/facebook/relay/commit/96d9703761e222a740cbefbed567e6cfe8015e69JSResource Flow interface from Relay.useFragment.New warning in RelayPublishQueue if if RelayPublishQueue::run() is called again during a run(): https://github.com/facebook/relay/commit/382353481622a
writeQueryParams: (
dir: CodegenDirectory,
filename: string,
moduleName: string,
params: RequestParameters,
) => void
preloadQuery(), which makes it usable without the special $Parameters file: https://github.com/facebook/relay/commit/edb46706085a35699197300e6238f022982a2badgetModuleIfRequired replaced with queryResource in the EntryPoints: https://github.com/facebook/relay/commit/32f4a71df153b0ea1b0eb40cf8b164db6cbff2d3RelayCompiler: added a new directive (https://github.com/facebook/relay/commit/3dd79e859144030158fe996e714ebfd7b16751fd) @DEPRECATED__relay_ignore_unu…
Commits: https://github.com/facebook/relay/compare/v6.0.0...v7.0.0
Variables are no longer set in Relay Context when using a QueryRenderer. This means that any product code that was relying on reading variables from RelayContext will break. If you need to access the variables that were set at a query root, the recommended approach is to manually pass them down through the component tree in product code.
Removed old RelayNetworkLogger, and relay-runtime no longer exports createRelayNetworkLogger. This logger is being replaced with event based logging on the Environment which will allow us to have richer and more contextual events logged with more detail on what's going on. Wrapping the actual network request doesn't work well as some "requests" might never actually end up on the network when they can be fulfilled completely from the store.
The constructor signature of Store constructor changed; specifically the second argument to the constructor is now an options object. Any product code directly constructing a Store and passing a second argument will need to be updated.
Relay Compiler no longer relies on graphql-js for query validation. Most of the validation rules we used previous are now part of the RelayParser itself, while the remainder and implemented as transforms (https://github.com/facebook/relay/commit/15e8d2201fdad47596e1acfb3a5daa3fb7511a8e). Additionally, we've removed the concept of RelayIRValidations (https://github.com/facebook/relay/commit/da01bf3fc18774115821fc4a33558b51e04a82e4), which ran after IR transformation.
@defer is no longer allowed on inline fragments, since we can’t communicate a loading state with Suspense when used on an inline fragment. @defer is now only supported on fragment spreads.
@DEPRECATED__relay_ignore_unused_variables_error to suppress errors that were surfaced after we've migrated from GraphQL NoUnusedVariablesRule to RelayIRTransform validation. GraphQL NoUnusedVariablesRule was not aware of the difference between root (operation) variables and local fragment variables (defined by @argumentDefinitions) - because of that, it was considering the local fragment variables that have the same name as the root variable as used and did not report the violation. But in Relay compiler, we know this distinction, and we already keep track of the root variables and can report those invalid cases. Unfortunately, this revealed multiple violations that weren't possible to fix without product team involvement. For this purpose, we added a directive that can be used to temporarily suppress the error while teams fix their queries.@refetchable directive on a fragment: we no longer enforce that the argument for the node field is called id; it can be called anything as long as it’s an ID type.__id field anywhere that __typename can be selected, in order to fetch the internal cache key of an entity. The primary use-case for this is updating records that don’t have an id. Before, updating or deleting such entities would require writing an updater function that traversed from the nearest strong entity (w an id); now, developers can directly target records with e.g. store.get(record.__id) in an updater function.null as default value of enum: https://github.com/facebook/relay/commit/6946e85da4f2646db7901790f3ade406c753fd03@refetchable connection metadata for custom handlers.16.9.0.babel-preset-fbjs to 3.3.0type and typeCondition in GraphQL IR types to use Relay internal representation of GraphQL type (https://github.com/facebook/relay/commit/2606f32674f75513726207ceb198c906c276e90c). Before this change, we were directly using graphql-js type instances. But eventually, our goal in Relay compiler is to get rid of the dependency on the graphql-js schema representation and use a faster/less memory intensive representation of the schema. We also build a Schema wrapper: https://github.com/facebook/relay/commit/9e6d9192d6516e16f0383e7b9094ecded77f1348 - that should help us during this migration.useFragment were shipped.useQuery hook; this might happen when useQuery starts a long-lived request, e.g. to poll for real time data.useQuery to not suspend indefinitely when server response doesn’t return all of the requested data. This might occur for example when making selections on abstract types.useBlockingPagination.@argumentDefitions.hasNextPage as false.renderPolicy_UNSTABLE, which determines whether data should be eagerly or lazily rendered.Commits: https://github.com/facebook/relay/compare/v5.0.0...v6.0.0
Commits: https://github.com/facebook/relay/compare/v5.0.0...v6.0.0
Commits: https://github.com/facebook/relay/compare/v4.0.0...v5.0.0
Commits: https://github.com/facebook/relay/compare/v4.0.0...v5.0.0
react-relay containers no longer consume variables from React context, but instead from fragment owners passed through fragment refs. This means that if you have a custom QueryRenderer or other component that set Relay Context, setting variables on that context will no longer affect descendant components.__tests__ directories: https://github.com/facebook/relay/commit/033a4bbc332e3d18c2bd37ebfde5f9f930d9c9e3[088afdf](https://github.com/facebook/relay/commit/088afdf347582533b9956adbc5b2a5e37fe9cfaf) viewer fieldCommits: https://github.com/facebook/relay/compare/v3.0.0...v4.0.0
Commits: https://github.com/facebook/relay/compare/v3.0.0...v4.0.0
graphql tag is no longer valid input), since graphql tags no longer implicitly produce object wrappers during our babel transform: https://github.com/facebook/relay/commit/1f260861c08545fd3f6c390f5c9e2692665449be.
@connection on a fragment definition.@arguments are defined on the calleeUpdates in testing tools:
createMockEnvironment, you will be able to create an instance of RelayMockEnvironment, a Relay environment specifically for your tests. The instance created by createMockEnvironment is implementing the Relay Environment Interface and it also has an additional Mock layer, with methods that allow to resolve/reject and control the flow of operations (queries/mutations/subscriptions).MockPayloadGenerator is to improve the process of creating and maintaining the mock data for tested components.Added full support for client schema extensions: now full GraphQL types can be defined in the client schema (as opposed to just extending existing server types), and they will be properly retained during garbage collection when rendered.
Using new fetchQuery implementation inside QueryRenderer which de-dupes identical requests in flight.
Add config support for babel-plugin-relay/macro (#2646) @sgwilym
main entry point in package.json for react-relay and relay-test-utilscreateRelayContext now in relay-runtime package to prevent multiple instances of packages that have "peerDependencies".@stream and @stream_connection@match directiveCommits: https://github.com/facebook/relay/compare/v2.0.0...v3.0.0
Commits: https://github.com/facebook/relay/compare/v2.0.0...v3.0.0
react-relay/modern has been moved to react-relay/.graphql-js validation rule (checking that variables are used in allowed positions) in the compiler which could incorrectly report errors when an argument in the @arguments directive conflicted with the nearest parent field argument. Relay-compiler already implements the same validation internally and is aware of @arguments/@argumentDefinitions.validateNames option in compiler which was always true.Commits: https://github.com/facebook/relay/compare/v1.7.0...v2.0.0
Commits: https://github.com/facebook/relay/compare/v1.7.0...v2.0.0
graphql to 14.0.0react to 16.5.0inputFieldWhitelist to optionalInputFields.environment.unstable_internal.getSelector(...) has changed.ReactRelayContext is now exported from react-relay.PayloadError in RelayNetwork interface.missingFieldHandlers in the Relay environment. These handlers allow developers to provide a fallback for missing data for a query when environment.check() is called.@connection. This is useful for products that want to customize the way newly fetched items are merged into an existing connection.recycleNodesInto no longer produces runtime error in DEV mode trying to mutate frozen objects (#2193)ConcreteRequest to provide more flexibility for our fetching apis.RelayMarkSweepStore to RelayModernStore.Viewer, Query, or a type that implements Node). No user api is provided yet.Commits: https://github.com/facebook/relay/compare/v2.0.0-rc.1...v2.0.0-rc.2
Commits: https://github.com/facebook/relay/compare/v2.0.0-rc.1...v2.0.0-rc.2
graphql-compiler into relay-compiler (#2593)environment.unstable_internal.getSelector(...) has changed.ReactRelayContext is now exported from react-relay.Viewer, Query, or a type that implements Node). No user api is provided yet.ConcreteRequest to provide more flexibility for our fetching apis.Commits: https://github.com/facebook/relay/compare/v1.7.0-rc.1...v2.0.0-rc.1
Commits: https://github.com/facebook/relay/compare/v1.7.0-rc.1...v2.0.0-rc.1
Added a new relay-experimental package which exposes a few experimental APIs.
Removed long deprecated RelayNetwork.streamQuery and RelayNetwork.sendSubscription
Commits: https://github.com/facebook/relay/compare/v1.6.2...v1.7.0
This release comes with two exciting contributions from external contributors:
While we at Facebook only support JS and Flow flavored JS and generate optional Flow types, supporting TypeScript had been difficult. #2293 by @alloy does the required refactoring to allow other developers to write plugins to add this missing support.
Create React App tries to minimize dependencies, so including Relay's Babel plugin for everyone didn't make much sense. This meant that using Relay with Create React App wasn't possible without ejecting. This release adds babel-plugin-relay/macro (@apalm, #2171) which in the upcoming react-scripts@2.0.0 will make it possible to use Relay without ejecting powered by babel-plugin-macros (http://yarn.pm/babel-plugin-macros).
Removed long deprecated RelayNetwork.streamQuery and RelayNetwork.sendSubscription
This release doesn't contain many commits, but comes with two exciting additions from external contributors:
While we at Facebook only support JS and Flow flavored JS and generate optional Flow types, supporting TypeScript had been difficult. #2293 by @alloy does the required refactoring to allow other developers to write plugins to add this missing support.
Create React App tries to minimize dependencies, so including Relay's Babel plugin for everyone didn't make much sense. This meant that using Relay with Create React App wasn't possible without ejecting.
This release adds babel-plugin-relay/macro (@apalm, #2171) which in the upcoming react-scripts@2.0.0 will make it possible to use Relay without ejecting powered by babel-plugin-macros.
relay-compiler is no longer a peerDependency of relay-runtime as it's not needed during deployment. Make sure to keep all Relay packages at the same version! (@kassens)RelayNetwork.streamQuery and RelayNetwork.sendSubscriptionFix relay-runtime main entry for OSS
Fixed:
Use React.forwardRef. This is a breaking change for people relying on the relayContainer.refs.component implementation detail.
Commits: https://github.com/facebook/relay/compare/v1.6.0...master
Potentially Breaking:
graphql peer dependency to ^0.13.0React.forwardRef. This is a breaking change for people relying on the relayContainer.refs.component implementation detail.New:
@relay(mask: false) directive for fragment *definitions: *Applied to a fragment definition, @relay(mask: false) changes the generated Flow types to be more usable when the fragment is spread with the same directive; The Flow types will no longer be exact objects and no longer contain internal marker fields.Fixed:
refetchConnection in Pagination ContainerRelayConnectionHandler now properly writes page_info after refetching a connectionRelayContainerUtils didn't recognize React.forwardRef as React.Componentmutation or subscription updater functionsImproved:
relay-runtime, set main entry in relay-runtime package.json.dedupeJSONStringify is now more effectiverelay-compiler by caching client schema extensions.applyOptimisticUpdate on RelayModern.relay-compiler can now compile JS files with optionalChaining syntax.relay-compiler can now compile JS files with nullishCoalescingOperator syntax.relay-compiler can now compile JS files with optionalCatchBinding syntax.relay-compiler has better warnings when required variables are not passed in.relay-compiler now generates operation Flow types: 5d83328.fbjs dependency to 0.8.17.fast-glob dependency to 2.2.2.Remove some usages of deprecated React lifecycle methods and changes to make containers React Async safe.
Commits: https://github.com/facebook/relay/compare/v1.5.0...v1.6.0
Breaking:
^16.3.0Potentially Breaking:
__type__ fieldsFixed:
jest --watch work with React 16Improved:
graphql-compiler out of relay-compiler as its own independent packagegraphql a peer dependencygraphql-js to v0.13.2relay-compiler: Makes flow generated '%future added value' for enums optionalThis release introduces several changes, some of the most relevant ones are highlighted here.
This release introduces several changes, some of the most relevant ones are highlighted here.
New:
.graphql files. Extensions only work on existing types, and does not currently support adding client-only types to the schema.dataFrom prop.ConcreteNode format supporting Batch requests.Potentially Breaking:
src to the relay-compiler (#2346).RelayNetwork.execute to return a RelayObservable with variables and node, in addition to the QueryPayload. However, RelayNetwork.create maintains the same API (c058ffc4).Fixed:
RelayConcreteVariables (03985855).RANGE_ADD mutation (7f2013d6).Improved:
getIdentifierForSelection.NoFragmentCyclesRule; can now use Fragments recursively.RecordSourceInspector which is of marginal value, especially now that we have a useful devtools app.—quiet.graphql.experimental.Nothing published for this version
*This is the first NPM release to include the MIT license*. Read more about this change: https://medium.com/@leeb/relicensing-the-graphql-specificatio
New:
Deprecated graphql.experimental All features now supported directly in graphql literal tags.
New:
const {Observable} = require('relay-runtime') to use Relay's lightweight Observable implementation which seeks to follow the Observable specification.yarn add relay-devtools) (86b63d44a2228705975294d4bfcd34ea2de88f92)graphql.experimental All features now supported directly in graphql literal tags. (9afd76498942ef8c7c8de64c6bfc5b1da2a1dd65)Observer when loading more data (ef7aa5bf2963d4de592a86109b2bec0a9931b813)Potentially Breaking:
execute() and executeMutation() (0202673f046cd9a52181388c9910ab1e6082e803)Fixed:
@include in classic/compat mode (d65291156865c52e67e6afb0473a07879979b54d)__typename and id in the correct order (95319d19c2027661efd400eea3137ba7b6885431)@arguments in compat mode (1ce348a5bc472a58607279c08e2236b8459b5877)@argumentDefinitions would not be validated first (50803a5c3951ff7f34fa46bc5ad774fba12dc111)A small update since 1.2.0 that mainly exposes a few new internals.
A small update since 1.2.0 that mainly exposes a few new internals.
New:
graphql tags now support null literal values (@nkohari e7962fb9338b41ed3c9a302384d26a86b7514c0a)RelayEnvironment to use Observables instead of Promises to prepare for streaming and other advanced usages (@leebyron)formatGeneratedModule on relay-compiler to allow more customization of the compiler (@robrichard 7b440133446681d660d785c11c137d029fcf804f)--validate to relay-compiler to validate without writing files (@ajhyndman af35c307e16e613e4dee46dba040c0c990919b3c)RelayConnectionInterface is now injectable for legacy clients (@kassens d9c1eb08f043e369dc5d584968b96d5c3bd11ad9)Fixed:
RelayRecordProxy#setValue now accepts arrays of scalar values (@kassens 7a2b27ea0e93d37857358707f40a2ededef0cfdc)eslint-config-fbjs dependency from relay-compiler (@mwalkerwells 7b914f0ec7b49004a9d63107884e501a92020b95)In addition to all of the changes in v1.2.0-rc1, v1.2.0 includes:
In addition to all of the changes in v1.2.0-rc1, v1.2.0 includes:
New:
@inline to @relay(mask: false) (c7235ab93d832f3f41f6c728a0dc9e5549d31c5d) and can be used in both Relay modern and Relay compat (20327fd8b4af2ae3c8a254d8878f74c9d3d63e4a)pageInfo when using pagination controllers (9686119769ea8fb7da684215a572fdeee2a1f92e)Fixed:
Improved:
peerDep between relay-runtime and relay-compiler to create early warnings if dependencies are misaligned (25826464fd4e0778e518d417d1ede04686a2ea68)Your coding agent can read these notes before it upgrades. Set up the MCP server →