facebook/relay (babel-plugin-relay)
### [`v18.0.0`](https://redirect.github.com/facebook/relay/releases/tag/v18.0.0): Version 18.0.0 Release Notes
[Compare Source](https://redirect.github.com/facebook/relay/compare/v17.0.0...v18.0.0)
With version 18, the Relay team at Meta and our community of contributors have made several significant improvements to Relay:
- Improved validation of argument types
- `@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.
- Intellisense for your Relay config file
- Rename refactoring tools and inlay hints for fragment arguments
Read all about them in more detail below:
#### Breaking Changes
##### Improved validation of field and fragment arguments
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"
}
}
}
#### Major features
##### [@alias](https://redirect.github.com/alias) fragment aliases released as stable
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.
**[Read more about @alias](https://relay.dev/docs/next/guides/alias-directive/)**
##### [@catch](https://redirect.github.com/catch)
`@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](https://spec.graphql.org/October2021/#sec-Handling-Field-Errors).
**[Read more about @catch](https://relay.dev/docs/next/guides/catch-directive/)**
##### [@throwOnFieldError](https://redirect.github.com/throwOnFieldError)
`@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](https://spec.graphql.org/October2021/#sec-Handling-Field-Errors).
**[Read more about @throwOnFieldError](https://relay.dev/docs/next/guides/throw-on-field-error-directive/)**
##### Semantic Nullability
`@throwOnFieldError` unlocks a powerful new feature when combined with a schema that has fields annotated with [`@semanticNonNull`](https://specs.apollo.dev/nullability/v0.2/). `@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](https://relay.dev/docs/next/guides/semantic-nullability/)**
##### Relay Resolvers can now have access to context
Thanks for [Mark Polak](https://redirect.github.com/Markionium) and [Drew Atkinson](https://redirect.github.com/drewatk) from Microsoft, [Relay Resolvers](https://relay.dev/docs/next/guides/relay-resolvers/introduction/) can now be configured to accept a shared context object, similar to [standard GraphQL resolvers](https://graphql.org/learn/execution/#root-fields--resolvers).
[Pull Request](https://redirect.github.com/facebook/relay/pull/4704)
**[Read more about Resolver context](https://relay.dev/docs/next/guides/relay-resolvers/context/)**
##### Ability to opt out of Relay Compiler source control integration
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.
[Pull Request](https://redirect.github.com/facebook/relay/pull/4767)
#### Editor Integration Improvements
Thanks to Tobias Tengler, Relay's [editor support](https://relay.dev/docs/next/editor-support/) now includes:
- **Intellisense (autocomplete, hover tooltips, diagnostics) for the Relay config file.** This fills a critical gap since the Relay config is quite under-documented. ([#4724](https://redirect.github.com/facebook/relay/issues/4724)) by tobias-tengler
- Editor integration ([#4724](https://redirect.github.com/facebook/relay/issues/4724)) by tobias-tengler
- Generate JSON schema for compiler config ([#4723](https://redirect.github.com/facebook/relay/issues/4723)) by Jordan Eldredge
- Rename refactoring tools ([#4581](https://redirect.github.com/facebook/relay/issues/4581)) by tobias-tengler
- Add Inlay Hints for Fragment arguments ([#4740](https://redirect.github.com/facebook/relay/issues/4740)) by tobias-tengler
- Improved documentation links in errors and hover tooltips ([#4741](https://redirect.github.com/facebook/relay/issues/4741)) by tobias-tengler
#### Additional runtime logging integrations
- \[9b24ad]: Log notify stats by Tianyu Yao
- \[ed8a7f]: Add logging for DataChecker by Tianyu Yao
- \[462b01]: Add logging for store lookup by Tianyu Yao
- \[1faea5]: Add more loggings for GC by Tianyu Yao
- \[f42215]: Add more information to execute.next log by Tianyu Yao
#### Additional Improvements
- \[e84b10]: Inline enum values in hot code paths by Jan Kassens
- \[ebd987]: Strictify relay entrypoint typing by Sam Zhou
- \[989ebf]: Improve error reporting for argument type errors by Jordan Eldredge
- \[3ba54c]: Use more precise variance for some relay types by Sam Zhou
- \[9f0e9e]: Improve schema-validation error messaging by Steven Chaitoff
- \[eec960]: Report schema parsing errors for synced schema sources ([#4719](https://redirect.github.com/facebook/relay/issues/4719)) by tobias-tengler
- \[176f96]: Parallelize dumping schemas to disk by Deepak Singh
- \[e492d7]: Fix out of date component name in Mutations & Updates by Lynn Yu
- \[0f49c2]: Skip importing export types in TS ([#4754](https://redirect.github.com/facebook/relay/issues/4754)) by Drew Atkinson
- \[aba9e9]: Ignore null/undefined queries in entrypoints by Jordan Eldredge
- \[d5f1a0]: Correctly report unaliased fragments within inline fragment with [@skip](https://redirect.github.com/skip) by Jordan Eldredge
- \[2ad28f]: Disallow Node refetchable query on interfaces without implementations by Tianyu Yao
- \[c446d4]: Fix Relay incremental build for enums by Evan Yeung
- \[7998bc]: Support multiple [@module](https://redirect.github.com/module) fragments in the same selection if they have [@alias](https://redirect.github.com/alias) ([#4744](https://redirect.github.com/facebook/relay/issues/4744)) by Jordan Eldredge
- \[df2aca]: I think we could allow [@module](https://redirect.github.com/module) in the same selection if they have different keys by Jordan Eldredge
- \[294cb8]: Ensure we strip alias metadata from selections within inline fragments by Jordan Eldredge
- \[531c6f]: Fix syntax error when using the new relay resolver by Tianyu Yao
- \[6e47ac]: Return and handle all required_on_non_null_field errors by Gordy French
- \[2b5028]: Ensure documents are synced before calculating completions [#4473](https://redirect.github.com/facebook/relay/issues/4473) by Jordan Eldredge
- \[c43429]: Add editor support for JSON config schema ([#4724](https://redirect.github.com/facebook/relay/issues/4724)) by tobias-tengler
- \[4d2fe9]: Error on multiple graphql type definitions on one flow type by Tianyu Yao
- \[99003d]: Prevent using [@alias](https://redirect.github.com/alias) within [@match](https://redirect.github.com/match) by Jordan Eldredge
- \[7491d3]: Update relay resolve API doc by Tianyu Yao
- \[5d1225]: Fix incremental build when enum field argument changes by Monica Tang
- \[0c5d69]: Support incremental schema change for union changes by Lynn Yu
- \[d53615]: Refactor alias to always use inline fragments (and compose with other features) by Jordan Eldredge
- \[86800e]: Add compiler command to emit json schema of config file by Jordan Eldredge
- \[80e041]: Minor spell checking by Gordy French
- \[6a2c39]: Validate that [@match](https://redirect.github.com/match) fields always have supported arg by Jordan Eldredge
- \[7bd521]: Only validate alias within each selection set by Jordan Eldredge
- \[44cbff]: Support Client Edge to Client Union for strong types by Monica Tang
- \[d35688]: Avoid reading inline fragments if abstract type condition does not match by Jordan Eldredge
- \[3787b8]: Handle case where [@required](https://redirect.github.com/required) bubbles to [@aliased](https://redirect.github.com/aliased) inline fragment on abstract type by Jordan Eldredge
- \[349334]: [@required](https://redirect.github.com/required) should bubble nullable to parent semantic-non-null linked field by Gordy French
- \[f96121]: Allow abstract inline fragments to be omitted by Daniel Lo Nigro
- \[43bd9b]: Revert [`D542067`](https://redirect.github.com/facebook/relay/commit/D54206758): Validate edgeTypeName argument points to an existing type by Amy Hwang
#### Documentation Improvements
- \[c54830]: Docs for [@catch](https://redirect.github.com/catch) by Itamar Kestenbaum
- \[f07f56]: Update semantic nullability docs to remove feature flag that is no-longer needed by Jordan Eldredge
- \[861caa]: Fill in definitions for [@stream](https://redirect.github.com/stream) and @stream_connection in Glossary by Lynn Yu
- \[e46ba9]: Document current support for experimental semantic nullability ([#4770](https://redirect.github.com/facebook/relay/issues/4770)) by Jordan Eldredge
- \[642e03]: Add definitions for [@live](https://redirect.github.com/live) and @live_query to glossary by Lynn Yu
- \[27b2a1]: Document resolvers constants by Jordan Eldredge
- \[175098]: [@throwOnFieldError](https://redirect.github.com/throwOnFieldError) documentation by Gordy French
- \[794cc3]: Pagination documentation fixes by Lynn Yu
- \[23a7c2]: Fix the connection key in the mutations tutorial ([#4751](https://redirect.github.com/facebook/relay/issues/4751)) by Sviatoslav Abakumov
- \[bf6153]: Fix small errors in docs by Lynn Yu
- \[99f4f6]: Organize sidebar for oss site by Evan Yeung
- \[0ab687]: Re-organize hierarchy of docs interally by Evan Yeung
- \[aa6538]: UseQueryLoader clarification by Monica Tang
- \[9f314a]: Fix GraphQL Field name for story thumbnail examples by Jerry Francois
- \[285dc2]: Spelling and capitalization by Gordy French
- \[0e57c3]: Fix unclosed jsx tag by Monica Tang
- \[7fccac]: Fix minor typo in editor-support.md ([#4721](https://redirect.github.com/facebook/relay/issues/4721)) by SY Ryu
- \[c632b4]: Link to Relay website [@defer](https://redirect.github.com/defer) [@stream](https://redirect.github.com/stream) docs by Monica Tang
- \[d61ce0]: S/class/className/ in MDX ([#4716](https://redirect.github.com/facebook/relay/issues/4716)) by Paul O’Shannessy
- \[98d76c]: Add instructions to run relay compiler after query update ([#4718](https://redirect.github.com/facebook/relay/issues/4718)) by Matthew Pawley
- \[dbae5c]: Link GQL node definition in useRefetchableFragment section by Danny Zou
#### Miscellaneous
- \[457e0c]: Update relay compiler README by Monica Tang
- \[36e9ea]: Remove loadQuery during render warning ([#4731](https://redirect.github.com/facebook/relay/issues/4731)) by Jordan Eldredge
#### Experimental Changes
- \[8cb637]: Support in useFragmentInternal by Joe Savona
- \[9125e2]: Support returning an interface in `IdOf` by Tianyu Yao
- \[a1ce49]: Schemagen should allow list items to be true non-null by Gordy French
- \[a726fc]: Add semanticNonNull support to generated schemas by Gordy French
- \[4a378d]: Add support for global custom scalars by Evan Yeung
- \[d3afbb]: Support [@deprecated](https://redirect.github.com/deprecated) annotation by Lynn Yu
- \[2efe7a]: Add support for fragment arguments by Evan Yeung
- \[ce4388]: Add test for conflicting arguments by Evan Yeung
- \[f239b7]: Add new relayresolver syntax to documents by Tianyu Yao
- \[b26951]: Disallow non-nullable return type by Tianyu Yao
- \[2152df]: Support attaching resolver fields onto Query by Tianyu Yao
- \[6ddd80]: Map Flow -> GraphQL Scalars in schema gen by Evan Yeung
- \[628b42]: Attach locations to parent types by Tianyu Yao
- \[884c96]: Resolve return flow types to their flow types by Tianyu Yao
- \[a1b186]: Unify processing weak fields by Tianyu Yao
- \[217eb3]: Unify processing rootFragment fields by Tianyu Yao
- \[5ee605]: Extract module for getting import and export by Tianyu Yao
- \[2a3c04]: Fix IdOf Flowtype by Tianyu Yao
- \[615020]: Add variable cycle detection by Jordan Eldredge
- \[bb6f7b]: Add correct root fragment information by Evan Yeung
#### And more
There were over 100 additional commits since our last release which have been omitted from this doc
### [`v17.0.0`](https://redirect.github.com/facebook/relay/releases/tag/v17.0.0): Version 17.0.0 Release Notes
[Compare Source](https://redirect.github.com/facebook/relay/compare/v16.2.0...v17.0.0)
Since our [last release](https://redirect.github.com/facebook/relay/releases/tag/v16.2.0) in January of this year, we've made many improvements to Relay. Themes include:
- Improved correctness checking and validation
- Additional editor features
- Experimental features exploring error handling and nullability
#### Breaking Changes
##### Schema Validation
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.
```json5
// relay.config.json
{
//...
"featureFlags": {
"disable_schema_validation": true
}
}
```
\[[`ccc4465`](https://redirect.github.com/facebook/relay/commit/ccc4465e6a47)] by Jordan Eldredge
##### Edge Type Validation
We now validate that the names passed to directives like [`@prependNode` and `@appendNode`](https://relay.dev/docs/guided-tour/list-data/updating-connections/#appendnode--prependnode) are valid typenames. You can opt out of this validation with the following feature flag in your compiler config:
```json5
// relay.config.json
{
//...
"featureFlags": {
"disable_edge_type_name_validation_on_declerative_connection_directives": {
"kind": "enabled"
}
}
}
```
\[[`53b2436`](https://redirect.github.com/facebook/relay/commit/53b24361bb4d)] by tobias-tengler
#### Bug fixes
- \[[`f87e77d`](https://redirect.github.com/facebook/relay/commit/f87e77daecc4)]: Fix MockPayloadGenerator for deferred fragments in lists by Fernando Gorodscy
- \[[`24b557a`](https://redirect.github.com/facebook/relay/commit/24b557adeb88)]: Use default values from mock resolver for Relay 3D payload by Andrey Lunyov
- \[[`59ff9c1`](https://redirect.github.com/facebook/relay/commit/59ff9c18a84b)]: Mark resolves as clean again if we reread their fragment and find data unchanged by Jordan Eldredge
- \[[`0d7a3d0`](https://redirect.github.com/facebook/relay/commit/0d7a3d04d7a9)]: Input fields with defaults shouldn't be required ([#4647](https://redirect.github.com/facebook/relay/issues/4647)) by Graeme Coupar
- \[[`7cc4f2b`](https://redirect.github.com/facebook/relay/commit/7cc4f2b3d36d)]: Check if condition on defer/stream fragments by Fernando Gorodscy
- \[[`05d64cc`](https://redirect.github.com/facebook/relay/commit/05d64ccfd279)]: Update GraphQL parser to consume escaped characters by Monica Tang
- \[[`448aa67`](https://redirect.github.com/facebook/relay/commit/448aa67d2a11)]: Fix Flow Types in RelayObservable by Jerry Francois
#### Improvements
##### Runtime Improvements
This release includes a new implementation of our hooks which are significantly more efficient in terms of memory use. Thanks to [Dave McCabe](https://redirect.github.com/davidmccabe) for his work on this huge project.
- \[[`9f03ea5`](https://redirect.github.com/facebook/relay/commit/9f03ea52fd86)]: Make new useFragment implementation the default by Andrey Lunyov
##### Editor Integration Improvements
**Huge shout out to community contributor [Tobias Tengler](https://redirect.github.com/tobias-tengler)** for many improvements to our [Editor Support](https://relay.dev/docs/editor-support/) via our [VSCode extension](https://marketplace.visualstudio.com/items?itemName=meta.relay). 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.
- \[[`dc2cb85`](https://redirect.github.com/facebook/relay/commit/dc2cb85aa820)]: Add code action to rename fragment ([#4697](https://redirect.github.com/facebook/relay/issues/4697)) by tobias-tengler
- \[[`68c7cca`](https://redirect.github.com/facebook/relay/commit/68c7ccafb3ef)]: Add SchemaDocument go to definition LSP support ([#4669](https://redirect.github.com/facebook/relay/issues/4669)) by tobias-tengler
- \[[`8fd21e7`](https://redirect.github.com/facebook/relay/commit/8fd21e75648a)]: Attach previous location to duplicate type diagnostic by Jordan Eldredge
- \[[`dd9d3a0`](https://redirect.github.com/facebook/relay/commit/dd9d3a03e969)]: Support inlay hints by Jordan Eldredge (Requires upgrading to v2.3.0 of our [VSCode extension](https://marketplace.visualstudio.com/items?itemName=meta.relay))
- \[[`964e078`](https://redirect.github.com/facebook/relay/commit/964e078395a8)]: Activate LSP for schema and schema extension files ([#4652](https://redirect.github.com/facebook/relay/issues/4652)) by tobias-tengler
- \[[`bb41169`](https://redirect.github.com/facebook/relay/commit/bb411693d638)]: Support go to definition for arguments ([#4605](https://redirect.github.com/facebook/relay/issues/4605)) by tobias-tengler
- \[[`bbddbf3`](https://redirect.github.com/facebook/relay/commit/bbddbf3b97f3)]: Report errors if location provider fails ([#4588](https://redirect.github.com/facebook/relay/issues/4588)) by Jordan Eldredge
- \[[`964e078`](https://redirect.github.com/facebook/relay/commit/964e078395a8)]: Activate LSP for schema and schema extension files ([#4652](https://redirect.github.com/facebook/relay/issues/4652)) by tobias-tengler
##### Compiler Performance Improvements
- \[[`232985f`](https://redirect.github.com/facebook/relay/commit/232985faceaa)]: Parallel watchman queries for saved state and changed files by Gordy French
- \[[`ef22ae6`](https://redirect.github.com/facebook/relay/commit/ef22ae64b431)]: Run schema validation in parallel by Jordan Eldredge
- \[[`a7984bc`](https://redirect.github.com/facebook/relay/commit/a7984bcaa7aa)]: Speed up `watchman_query_time_before_subscribe` by Tianyu Yao
- \[[`acd17ec`](https://redirect.github.com/facebook/relay/commit/acd17ec66ac0)]: Use multithreaded zstd compression by Gordy French
- \[[`a7984bc`](https://redirect.github.com/facebook/relay/commit/a7984bcaa7aa)]: Speed up `watchman_query_time_before_subscribe` by Tianyu Yao
- \[[`f7b030e`](https://redirect.github.com/facebook/relay/commit/f7b030ec69f8)]: Split a project into multiple chunks and parallelize by Tianyu Yao
- \[[`bafd56b`](https://redirect.github.com/facebook/relay/commit/bafd56b13719)]: Parallelize GraphQLAsts::from_graphql_sources by Tianyu Yao
- \[[`69dbfee`](https://redirect.github.com/facebook/relay/commit/69dbfee34449)]: Parallelize from_graphql_sources_map by Tianyu Yao
- \[[`ce12ecf`](https://redirect.github.com/facebook/relay/commit/ce12ecfdfae8)]: Parallelize building schemas by Tianyu Yao
- \[[`586483e`](https://redirect.github.com/facebook/relay/commit/586483e8ef03)]: Parallelize from_file_source_changes by Tianyu Yao
- \[[`ee8523f`](https://redirect.github.com/facebook/relay/commit/ee8523f67d66)]: Implement SchemaDocument path resolution ([#4639](https://redirect.github.com/facebook/relay/issues/4639)) by Tobias Tengler
- \[[`5f1eb8a`](https://redirect.github.com/facebook/relay/commit/5f1eb8a67d65)]: Add path resolution for fragment arguments ([#4651](https://redirect.github.com/facebook/relay/issues/4651)) by tobias-tengler
- \[[`6601a35`](https://redirect.github.com/facebook/relay/commit/6601a3566fdb)]: Speed up LSP requests outside of GraphQL by Evan Yeung
- \[[`a5a7947`](https://redirect.github.com/facebook/relay/commit/a5a794743d6f)]: Incrementally build Enum schema changes by Evan Yeung
- \[[`ce6ea74`](https://redirect.github.com/facebook/relay/commit/ce6ea74fe225)]: Add go to definition support for type defined in variable definition ([#4629](https://redirect.github.com/facebook/relay/issues/4629)) by tobias-tengler
- \[[`2ba726b`](https://redirect.github.com/facebook/relay/commit/2ba726b7ec69)]: Add go to definition support for directives ([#4625](https://redirect.github.com/facebook/relay/issues/4625)) by tobias-tengler
##### Misc. Improvements
- \[[`29d9e55`](https://redirect.github.com/facebook/relay/commit/29d9e55d4183)]: Add `preferFetchable` argument to the [@refetchable](https://redirect.github.com/refetchable) directive by Andrey Lunyov
- \[[`f45b35f`](https://redirect.github.com/facebook/relay/commit/f45b35fdd579)]: New feature flag that will allow to opt-out [@fetchable](https://redirect.github.com/fetchable) types from the `node` query generation in [@refetchable](https://redirect.github.com/refetchable) by Andrey Lunyov
- \[[`9958e56`](https://redirect.github.com/facebook/relay/commit/9958e5616271)]: Print raw response on persisting parsing error by Tianyu Yao
- \[[`9cf21af`](https://redirect.github.com/facebook/relay/commit/9cf21af244b9)]: Integrate with Sapling or Git if they exist ([#4691](https://redirect.github.com/facebook/relay/issues/4691)) by Jon Janzen
- \[[`badd538`](https://redirect.github.com/facebook/relay/commit/badd5382d241)]: Migrate relay hooks to hook-syntax by Alex Taylor (alta)
- \[[`349b5a8`](https://redirect.github.com/facebook/relay/commit/349b5a89503c)]: Use client schema extension enum values as source of truth for Flow types by Jordan Eldredge
- \[[`d3c8d1c`](https://redirect.github.com/facebook/relay/commit/d3c8d1c23300)]: Add feature flag for fragment arguments ([#4648](https://redirect.github.com/facebook/relay/issues/4648)) by tobias-tengler
- \[[`9e9428e`](https://redirect.github.com/facebook/relay/commit/9e9428ed8dca)]: Add support for ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE flag in the the new hooks implementation by Andrey Lunyov
#### Documentation Improvements
- \[[`acb227a`](https://redirect.github.com/facebook/relay/commit/acb227af0492)]: **Fix search on relay.dev** ([#4715](https://redirect.github.com/facebook/relay/issues/4715)) by Paul O’Shannessy
- \[[`6b91a2e`](https://redirect.github.com/facebook/relay/commit/6b91a2edaa8a)]: Improve [compiler explorer](https://relay.dev/compiler-explorer/) ([#4698](https://redirect.github.com/facebook/relay/issues/4698)) by Jordan Eldredge
- \[[`4c5cd41`](https://redirect.github.com/facebook/relay/commit/4c5cd416e041)]: Add docs for `preferFetchable` argument by Andrey Lunyov
- \[[`95010c8`](https://redirect.github.com/facebook/relay/commit/95010c852a2d)]: Relay: Update Obsolete Docs Reference to `ReactTestUtils` by Tim Yung
- \[[`51a82f6`](https://redirect.github.com/facebook/relay/commit/51a82f698aab)]: Document Relay Resolvers ([#4547](https://redirect.github.com/facebook/relay/issues/4547)) by Jordan Eldredge
- \[[`ff8e80d`](https://redirect.github.com/facebook/relay/commit/ff8e80d9c9a9)]: Update docs to clarify behavior of refetchable variables with nullable fragment reference by Jordan Eldredge
- \[[`76d6d77`](https://redirect.github.com/facebook/relay/commit/76d6d77532fa)]: Demonstrate using custom scalar to replace RelayResolverValue by Jordan Eldredge
- \[[`05cf065`](https://redirect.github.com/facebook/relay/commit/05cf0658487f)]: Fixing minor typo in website ([#4673](https://redirect.github.com/facebook/relay/issues/4673)) by Jeshuran Paul
- \[[`906f5ed`](https://redirect.github.com/facebook/relay/commit/906f5ed90b06)]: Relay docs: Fix shell script getting Prism'd as a JS comment by Robin Giese
- \[[`0109168`](https://redirect.github.com/facebook/relay/commit/01091686ab73)]: Relay docs: Tutorial page should have proper title by Robin Giese
- \[[`ea2cbbc`](https://redirect.github.com/facebook/relay/commit/ea2cbbc1d95b)]: Fix typos in the Relay Resolvers docs by Evan Yeung
- \[[`dc36b48`](https://redirect.github.com/facebook/relay/commit/dc36b48b8ec4)]: Fix typos in tutorial by Monica Tang
- \[[`14314f9`](https://redirect.github.com/facebook/relay/commit/14314f9b66d7)]: Escape asterisks in README.md ([#4635](https://redirect.github.com/facebook/relay/issues/4635)) by Chris Morin
- \[[`ee03182`](https://redirect.github.com/facebook/relay/commit/ee03182fa054)]: Fix(docs): add instructions about installing watchman if necessary in the tutorial ([#4620](https://redirect.github.com/facebook/relay/issues/4620)) by Mark Feng
- \[[`1256e73`](https://redirect.github.com/facebook/relay/commit/1256e7391dc4)]: Remove CodeSandbox Example by Jordan Eldredge
- \[[`b7f59af`](https://redirect.github.com/facebook/relay/commit/b7f59afc4b74)]: Chore(doc): improve relay compiler doc for persist ([#4608](https://redirect.github.com/facebook/relay/issues/4608)) by eMerzh
- \[[`8e557f9`](https://redirect.github.com/facebook/relay/commit/8e557f97105e)]: Fix typos ([#4597](https://redirect.github.com/facebook/relay/issues/4597)) by Kenneth Lum
- \[[`615c2d2`](https://redirect.github.com/facebook/relay/commit/615c2d234ddd)]: Fix(doc): update config name following update ([#4596](https://redirect.github.com/facebook/relay/issues/4596)) by eMerzh
#### Experimental Changes
We are also continuing to evolve many experimental features which are not yet stable enough to be enabled by default in Relay.
##### Relay Resolvers
[Relay Resolvers](https://relay.dev/docs/next/guides/relay-resolvers/introduction/) 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](https://relay.dev/docs/next/guides/relay-resolvers/introduction/) with instructions on how to enable them.
- \[[`ba5e48f`](https://redirect.github.com/facebook/relay/commit/ba5e48ff6a70)]: Add model resolvers for interfaces by Monica Tang
- \[[`55b8716`](https://redirect.github.com/facebook/relay/commit/55b8716e0282)]: Return an interface with multiple weak concrete types from a resolver field by Monica Tang
- \[[`46879b4`](https://redirect.github.com/facebook/relay/commit/46879b4f97e4)]: Multiple weak models implement an interface by Monica Tang
- \[[`98823ea`](https://redirect.github.com/facebook/relay/commit/98823ea3d853)]: Add model resolvers for unions by Monica Tang
- \[[`245602f`](https://redirect.github.com/facebook/relay/commit/245602fb54eb)]: Remove allow_legacy_verbose_syntax ParseOption by Lynn Yu
- \[[`cdab89f`](https://redirect.github.com/facebook/relay/commit/cdab89f4e04d)]: Remove ENABLE_CLIENT_EDGES runtime feature flag by Jordan Eldredge
- \[[`b26f3be`](https://redirect.github.com/facebook/relay/commit/b26f3beff1a8)]: Remove [@outputType](https://redirect.github.com/outputType) feature flag by Monica Tang
- \[[`7ce13bc`](https://redirect.github.com/facebook/relay/commit/7ce13bce108c)]: Remove LiveResolverStore from experimental export namespace by Jordan Eldredge
- \[[`f193cda`](https://redirect.github.com/facebook/relay/commit/f193cda39782)]: Invert the default for emit_normalization_node_for_client_edges by Jordan Eldredge
- \[[`0cac319`](https://redirect.github.com/facebook/relay/commit/0cac319f8546)]: Define resolver on interface with weak types by Monica Tang
- \[[`6bda98c`](https://redirect.github.com/facebook/relay/commit/6bda98c76956)]: Make interface model resolver fields compatible with client schema extension-defined concrete types by Monica Tang
Additionally, we are exploring the ability to extract Resolver type and field definitions directly from your typed JavaScript code, similar to how [Grats](https://jordaneldredge.com/blog/grats/) works. This work is still highly experimental, only supported for Flow, and not yet fully functional. *If you are interested in working with us to help bring this support to TypeScript, please get in touch.*
- \[[`722b18f`](https://redirect.github.com/facebook/relay/commit/722b18f5bfa3)]: Better error message for using an optional flow type for strong objects by Tianyu Yao
- \[[`4267075`](https://redirect.github.com/facebook/relay/commit/4267075e7c97)]: Implement schema generation for weak object fields by Evan Yeung
- \[[`5d2fa70`](https://redirect.github.com/facebook/relay/commit/5d2fa70dc611)]: Prevent docblock parsing error for new resolver syntax in LSP by Tianyu Yao
- \[[`36802d9`](https://redirect.github.com/facebook/relay/commit/36802d906946)]: Properly support nullable strong return type by Tianyu Yao
- \[[`8e5c565`](https://redirect.github.com/facebook/relay/commit/8e5c5657b887)]: Add "description" to Flow schema generation by Evan Yeung
- \[[`7e41583`](https://redirect.github.com/facebook/relay/commit/7e4158376a33)]: Fix passing empty documents to schema gen by Tianyu Yao
- \[[`8cce449`](https://redirect.github.com/facebook/relay/commit/8cce449a11c8)]: A RelayResolverValue generic by Tianyu Yao
- \[[`0d1b5c2`](https://redirect.github.com/facebook/relay/commit/0d1b5c2515e6)]: Add argument support for Flow schema generation by Evan Yeung
- \[[`95aaa48`](https://redirect.github.com/facebook/relay/commit/95aaa48412e2)]: `IdOf<>` return type by Tianyu Yao
- \[[`5052062`](https://redirect.github.com/facebook/relay/commit/505206292a32)]: Support boolean by Tianyu Yao
- \[[`77a87be`](https://redirect.github.com/facebook/relay/commit/77a87be08419)]: Add root fragment support to relay resolvers by Evan Yeung
- \[[`35f9763`](https://redirect.github.com/facebook/relay/commit/35f9763c565f)]: Pass fragment information to Flow schema generation code by Evan Yeung
- \[[`a8a41e2`](https://redirect.github.com/facebook/relay/commit/a8a41e2634c7)]: Treat existing resolve syntax fields as fields by Tianyu Yao
- \[[`16e28af`](https://redirect.github.com/facebook/relay/commit/16e28af78b47)]: Add [@live](https://redirect.github.com/live) to Flow schema generation by Evan Yeung
- \[[`49563f1`](https://redirect.github.com/facebook/relay/commit/49563f144ff6)]: Fix incorrect error message for Relay Resolver missing function param by Evan Yeung
- \[[`24510ae`](https://redirect.github.com/facebook/relay/commit/24510aeb2b29)]: Improve error messages for Relay Resolver schema generation imports by Evan Yeung
- \[[`433c93e`](https://redirect.github.com/facebook/relay/commit/433c93e4d08e)]: Improve error messages for resolver schema generation by Evan Yeung
- \[[`d1749df`](https://redirect.github.com/facebook/relay/commit/d1749dfef059)]: Add weak type definitions to Flow resolvers by Evan Yeung
- \[[`8fa3d43`](https://redirect.github.com/facebook/relay/commit/8fa3d4355468)]: Crate for extracting type information from JS definitions by Tianyu Yao
##### [@alias](https://redirect.github.com/alias)
We've added an [experimental new directive](https://relay.dev/docs/next/guides/alias-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.
- \[[`efab5ab`](https://redirect.github.com/facebook/relay/commit/efab5ab09deb)]: Complete [@alias](https://redirect.github.com/alias) ([#4699](https://redirect.github.com/facebook/relay/issues/4699)) by Jordan Eldredge
- \[[`868183c`](https://redirect.github.com/facebook/relay/commit/868183c58f7b)]: Refine [@alias](https://redirect.github.com/alias) enforcement by Jordan Eldredge
- \[[`6aaa9ce`](https://redirect.github.com/facebook/relay/commit/6aaa9ce0058f)]: Add directive to opt out of [@alias](https://redirect.github.com/alias) enforcement by Jordan Eldredge
##### Error Handling and Semantic Nullability
As part of our involvement with the GraphQL [Nullability Working Group](https://redirect.github.com/graphql/nullability-wg) we are exploring features to enable [explicit error handling](https://redirect.github.com/facebook/relay/issues/4416) and [semantic nullability](https://redirect.github.com/graphql/graphql-wg/discussions/1394). Neither of these features are officially available yet, but we're excited about what will become possible here.
- \[[`af1f9de`](https://redirect.github.com/facebook/relay/commit/af1f9deb5487)]: Disallow required on non-null and semanticNonNull fields by Gordy French
- \[[`56c099a`](https://redirect.github.com/facebook/relay/commit/56c099abec6b)]: Fix non-null-required validator's field traversal by Gordy French
- \[[`470c814`](https://redirect.github.com/facebook/relay/commit/470c8147acc1)]: Create CatchField for [@catch](https://redirect.github.com/catch) on Scalar by Itamar Kestenbaum
- \[[`38655ec`](https://redirect.github.com/facebook/relay/commit/38655ecf3375)]: Create CatchField for [@catch](https://redirect.github.com/catch) and throw unimplemented by Itamar Kestenbaum
- \[[`7bfd200`](https://redirect.github.com/facebook/relay/commit/7bfd2007c574)]: Emit proper Flow for semanticNonNull RelayResolverValue by Gordy French
- \[[`88a6ff9`](https://redirect.github.com/facebook/relay/commit/88a6ff9418da)]: Fix semanticNonNull levels support in resolver docblock by Gordy French
- \[[`c7d46c3`](https://redirect.github.com/facebook/relay/commit/c7d46c3621fc)]: Create CatchField feature flag by Itamar Kestenbaum
- \[[`696a1b3`](https://redirect.github.com/facebook/relay/commit/696a1b357096)]: Support [@catch](https://redirect.github.com/catch) directive in RelayReader by Itamar Kestenbaum
- \[[`d1cf472`](https://redirect.github.com/facebook/relay/commit/d1cf4722e33d)]: Emit semanticNonNull in generated schema by Gordy French
- \[[`ddfa2b0`](https://redirect.github.com/facebook/relay/commit/ddfa2b0e131e)]: Parse semanticNonNull from docblock by Gordy French
- \[[`145c788`](https://redirect.github.com/facebook/relay/commit/145c788063e9)]: Add allow_non_null_resolver_fields feature flag by Gordy French
- \[[`cebc7f0`](https://redirect.github.com/facebook/relay/commit/cebc7f0650ee)]: Experimental support for [@semanticNonNull](https://redirect.github.com/semanticNonNull) ([#4601](https://redirect.github.com/facebook/relay/issues/4601)) by Jordan Eldredge
### [`v16.2.0`](https://redirect.github.com/facebook/relay/releases/tag/v16.2.0)
[Compare Source](https://redirect.github.com/facebook/relay/compare/v16.1.0...v16.2.0)
##### Minor breaking changes
- \[[4e68155d732b](https://redirect.github.com/facebook/relay/commit/4e68155d732b)]: Reuse TypegenConfig for SingleProjectConfigFile ([#4585](https://redirect.github.com/facebook/relay/issues/4585)) by tobias-tengler
This change is a breaking change, as the `customScalars` config option in the single-project config must now be specified as `customScalarTypes`.
##### Added
- \[[40fe615ad6f8](https://redirect.github.com/facebook/relay/commit/40fe615ad6f8)]: [@preloadable](https://redirect.github.com/preloadable) Support ([#4515](https://redirect.github.com/facebook/relay/issues/4515)) by tobias-tengler
##### Bug fixes
- \[[b995eec40461](https://redirect.github.com/facebook/relay/commit/b995eec40461)]: Update config.ts for typo ([#4594](https://redirect.github.com/facebook/relay/issues/4594)) by Orta Therox
- \[[2f9e88affdc7](https://redirect.github.com/facebook/relay/commit/2f9e88affdc7)]: Fix goto references for TerseRelayResolver ([#4587](https://redirect.github.com/facebook/relay/issues/4587)) by tobias-tengler
- \[[d513e42f881e](https://redirect.github.com/facebook/relay/commit/d513e42f881e)]: Suspend on active promises for client edge queries in the new hooks implementation by Andrey Lunyov
- \[[eb0b7fcd991c](https://redirect.github.com/facebook/relay/commit/eb0b7fcd991c)]: Cleanup outdated records after model/output type resolvers updates by Andrey Lunyov
- \[[ece1fd953b98](https://redirect.github.com/facebook/relay/commit/ece1fd953b98)]: Fix SDLSchema replacing logic by Deepak Singh
- \[[d90dedfc577e](https://redirect.github.com/facebook/relay/commit/d90dedfc577e)]: Replace invariant in SuspenseResource with the warning in the case where GC is disabled by Monica Tang
- \[[9f135b8f92a7](https://redirect.github.com/facebook/relay/commit/9f135b8f92a7)]: Fix path on Windows ([#4544](https://redirect.github.com/facebook/relay/issues/4544)) by martin
- \[[aac57b30e812](https://redirect.github.com/facebook/relay/commit/aac57b30e812)]: UseFragmentInternal should suspend if environment changes and there is a query in flight by Andrey Lunyov
- \[[00aabd00be72](https://redirect.github.com/facebook/relay/commit/00aabd00be72)]: Fix client->client nullable model issue for PluralConcrete object output types by Monica Tang
- \[[7b3b0779b570](https://redirect.github.com/facebook/relay/commit/7b3b0779b570)]: Fix client->client nullable model issue for SingularConcrete object output types by Monica Tang
- \[[3873809c2df8](https://redirect.github.com/facebook/relay/commit/3873809c2df8)]: Handle missed updates from the low-priority state changes in the new hooks implementation by Andrey Lunyov
##### Improvements
- \[[0037d05c61d8](https://redirect.github.com/facebook/relay/commit/0037d05c61d8)]: Cleanup allow(unused_imports) by Cameron Pickett
- \[[ada971e33838](https://redirect.github.com/facebook/relay/commit/ada971e33838)]: Disallow some read time features in mutation responses by Jordan Eldredge
- \[[a2c7ed480e2d](https://redirect.github.com/facebook/relay/commit/a2c7ed480e2d)]: Relay-compiler diagnostic errors logging improvements ([#4574](https://redirect.github.com/facebook/relay/issues/4574)) by Alex Coleman
- \[[1a57f0832665](https://redirect.github.com/facebook/relay/commit/1a57f0832665)]: FIX(Graphql): Add support for input with default values ([#4540](https://redirect.github.com/facebook/relay/issues/4540)) by eMerzh
- \[[2f97f25e53a1](https://redirect.github.com/facebook/relay/commit/2f97f25e53a1)]: Consume LiveState from relay-runtime root in typegen by Jordan Eldredge
- \[[182a86647000](https://redirect.github.com/facebook/relay/commit/182a86647000)]: Fix missing space in diagnostic location print ([#4573](https://redirect.github.com/facebook/relay/issues/4573)) by Alex Coleman
- \[[5a18984e4155](https://redirect.github.com/facebook/relay/commit/5a18984e4155)]: Refactor model resolver codegen to re-use build_reader_relay_resolver by Monica Tang
- \[[1972913c2d12](https://redirect.github.com/facebook/relay/commit/1972913c2d12)]: Augment corpus digraph logic to intake a vec of TextSource by Monica Tang
- \[[06cb092ae28f](https://redirect.github.com/facebook/relay/commit/06cb092ae28f)]: Implement compiler command to get graphql text sources and program by Monica Tang
- \[[1a06f3269985](https://redirect.github.com/facebook/relay/commit/1a06f3269985)]: Use `Parameters` and indexed access type to extract PreloadParams by Sam Zhou
- \[[5cf0af11be92](https://redirect.github.com/facebook/relay/commit/5cf0af11be92)]: Update print_schema to support ARGUMENT_DEFINITION and INPUT_FIELD_DEFINITION directives by James Wren
- \[[4c25549bcb1a](https://redirect.github.com/facebook/relay/commit/4c25549bcb1a)]: More strict selectors equal check by Tianyu Yao
##### Documentation Improvements
- \[[8392b68a5137](https://redirect.github.com/facebook/relay/commit/8392b68a5137)]: Document `directives` argument for `@refetchable` ([#4520](https://redirect.github.com/facebook/relay/issues/4520)) by Daniel Lo Nigro
- \[[8ef4b47e69d0](https://redirect.github.com/facebook/relay/commit/8ef4b47e69d0)]: Document current behavior of server edges returning null by Jordan Eldredge
- \[[361d0b3fae9f](https://redirect.github.com/facebook/relay/commit/361d0b3fae9f)]: Typo fix ([#4561](https://redirect.github.com/facebook/relay/issues/4561)) by Randall Bennett
- \[[921f2a8715a1](https://redirect.github.com/facebook/relay/commit/921f2a8715a1)]: Fix(docs): normalize local data updates doc ([#4564](https://redirect.github.com/facebook/relay/issues/4564)) by Guilherme
##### Miscellaneous
- \[[4619f9706d97](https://redirect.github.com/facebook/relay/commit/4619f9706d97)]: Add a json output option by Tianyu Yao
- \[[49e4da17abbc](https://redirect.github.com/facebook/relay/commit/49e4da17abbc)]: Make compiler results seriaizable by Tianyu Yao
##### Experimental Changes
- \[[5718ca9fd9b2](https://redirect.github.com/facebook/relay/commit/5718ca9fd9b2)]: Transform to convert fragments and linked fields on abstract types to inline fragment by Monica Tang
- \[[399bf9201eba](https://redirect.github.com/facebook/relay/commit/399bf9201eba)]: 6/n - Add tests for errorResponseFields by Itamar Kestenbaum
- \[[27a062376ce3](https://redirect.github.com/facebook/relay/commit/27a062376ce3)]: 5/n - Add erroring on seeing relayFieldErrors by Itamar Kestenbaum
- \[[12d169fc9c23](https://redirect.github.com/facebook/relay/commit/12d169fc9c23)]: 4/n - Add logging on seeing relayFieldErrors by Itamar Kestenbaum
- \[[0a9d473edeee](https://redirect.github.com/facebook/relay/commit/0a9d473edeee)]: 3/n - Add RelayFieldError and rename RelayFieldError to TRelayFieldError by Itamar Kestenbaum
- \[[914794c4ddba](https://redirect.github.com/facebook/relay/commit/914794c4ddba)]: 2/n - Rename requiredFieldLogger to relayFieldLogger by Itamar Kestenbaum
- \[[af4afbdc2ab3](https://redirect.github.com/facebook/relay/commit/af4afbdc2ab3)]: 1/n - Add field errors to Snapshot by Itamar Kestenbaum
- \[[08c32cfede3b](https://redirect.github.com/facebook/relay/commit/08c32cfede3b)]: Integration test for resolvers implementing fields for interface by Jordan Eldredge
- \[[396a1dbfb8cd](https://redirect.github.com/facebook/relay/commit/396a1dbfb8cd)]: Expose live resolver modules outside of experimental-live-resolvers directory by Jordan Eldredge
- \[[bac5f9c790a9](https://redirect.github.com/facebook/relay/commit/bac5f9c790a9)]: Update for normalization node changes by Bhuwan Khattar
- \[[8dd004f4711a](https://redirect.github.com/facebook/relay/commit/8dd004f4711a)]: Add apply_to_normalization_ast config for resolvers_schema_module by Bhuwan Khattar
***
**Full Changelog**: https://github.com/facebook/relay/compare/v16.1.0...v16.2.0
### [`v16.1.0`](https://redirect.github.com/facebook/relay/releases/tag/v16.1.0)
[Compare Source](https://redirect.github.com/facebook/relay/compare/v16.0.0...v16.1.0)
##### Added
- \[[b683e8c2c355](https://redirect.github.com/facebook/relay/commit/b683e8c2c355)]: Add validations for custom scalar arguments by Alex Danoff
Enable flag `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.
##### Bug fixes
- \[[b379edf30a6e](https://redirect.github.com/facebook/relay/commit/b379edf30a6e)]: Handle the document type change from Query to Fragment by Andrey Lunyov
- \[[5ffcdbcf0114](https://redirect.github.com/facebook/relay/commit/5ffcdbcf0114)]: Fix missing validation for global variables in client-edges ([#4513](https://redirect.github.com/facebook/relay/issues/4513)) by Andrey Lunyov
- \[[8e0949d6d90a](https://redirect.github.com/facebook/relay/commit/8e0949d6d90a)]: Apply fragment renaming to resolver fields by Jordan Eldredge
##### Improvements
- \[[dfad61878904](https://redirect.github.com/facebook/relay/commit/dfad61878904)]: Fix types in RelayMockPayloadGenerator.js by George Zahariev
- \[[24ef22b4946c](https://redirect.github.com/facebook/relay/commit/24ef22b4946c)]: Adopt conditional type for useRefetchableFragment related functions by Sam Zhou
- \[[400cfa841445](https://redirect.github.com/facebook/relay/commit/400cfa841445)]: Refactor extra typegen config fields into TypegenOptions struct by Monica Tang
- \[[e694ba8792a6](https://redirect.github.com/facebook/relay/commit/e694ba8792a6)]: Use conditional type to power `EntryPointElementConfig` by Sam Zhou
- \[[1cc9d937ea1a](https://redirect.github.com/facebook/relay/commit/1cc9d937ea1a)]: Refactor extra artifact project config fields into extra_artifacts_config by Monica Tang
- \[[cf0fb394dbb6](https://redirect.github.com/facebook/relay/commit/cf0fb394dbb6)]: Incremental build compatible ResolversSchemaModule by Bhuwan Khattar
- \[[0d429f796e69](https://redirect.github.com/facebook/relay/commit/0d429f796e69)]: Implement fmt::Display for SchemaChange by Monica Tang
- \[[d48a0e025385](https://redirect.github.com/facebook/relay/commit/d48a0e025385)]: Fix RelayResolverModel-test by Monica Tang
- \[[ab92df525948](https://redirect.github.com/facebook/relay/commit/ab92df525948)]: Use placeholder in connection warning by Jan Kassens
- \[[6519571a092a](https://redirect.github.com/facebook/relay/commit/6519571a092a)]: Shallow freeze resolver value by Tianyu Yao
- \[[7f54255c92ea](https://redirect.github.com/facebook/relay/commit/7f54255c92ea)]: Do not mutate a shallowly frozen subtree by Tianyu Yao
- \[[904924c6925b](https://redirect.github.com/facebook/relay/commit/904924c6925b)]: Add validations for mutation resolvers by Alex Danoff
- \[[ef84550353b6](https://redirect.github.com/facebook/relay/commit/ef84550353b6)]: Handle panics in integration tests by Alex Danoff
- \[[5c7555b2c00d](https://redirect.github.com/facebook/relay/commit/5c7555b2c00d)]: Expose Sink type from relay-runtime ([#4516](https://redirect.github.com/facebook/relay/issues/4516)) by jaroslav-kubicek
- \[[9e0acc1d8c77](https://redirect.github.com/facebook/relay/commit/9e0acc1d8c77)]: Improve test coverage for recycleNodesInto on deeply frozen data by Tianyu Yao
- \[[6b89a29678ad](https://redirect.github.com/facebook/relay/commit/6b89a29678ad)]: Add normalizeResponse to MultiActorEnvironmentConfig by Bhuwan Khattar
- \[[61c7bffac76f](https://redirect.github.com/facebook/relay/commit/61c7bffac76f)]: Regression test for mutating complex resolver values by Tianyu Yao
- \[[22a3c89f9518](https://redirect.github.com/facebook/relay/commit/22a3c89f9518)]: Import ClientRequest for client only mutations by Alex Danoff
- \[[3017057e77eb](https://redirect.github.com/facebook/relay/commit/3017057e77eb)]: Only freeze plain JS objects and arrays by Tianyu Yao
- \[[f90edc4cb52a](https://redirect.github.com/facebook/relay/commit/f90edc4cb52a)]: Add regression test for fragment spreads with undefined global variables as arguments by Monica Tang
- \[[8011e22b6043](https://redirect.github.com/facebook/relay/commit/8011e22b6043)]: Add areEqualOwners to check for structural equality of fragment owners. ([#4500](https://redirect.github.com/facebook/relay/issues/4500)) by Andrey Lunyov
##### Documentation Improvements
- \[[e854fa04acfe](https://redirect.github.com/facebook/relay/commit/e854fa04acfe)]: Typos ([#4532](https://redirect.github.com/facebook/relay/issues/4532)) by Michael Letcher
- \[[06756209a4aa](https://redirect.github.com/facebook/relay/commit/06756209a4aa)]: Fix typo in website/docs/tutorial/queries-1.md ([#4522](https://redirect.github.com/facebook/relay/issues/4522)) by Priyansh Agrawal
- \[[59f5d604bb43](https://redirect.github.com/facebook/relay/commit/59f5d604bb43)]: Fix typo in Relay Mutations & updates doc by Mingshi Yang
- \[[a0b50ac400b4](https://redirect.github.com/facebook/relay/commit/a0b50ac400b4)]: Add graphql operation naming and organization docs by Aaron Lichtman
- \[[19970477942d](https://redirect.github.com/facebook/relay/commit/19970477942d)]: Add blog post explaining how Relay provides unique value in data loading by Jordan Eldredge
- \[[4668757a37e9](https://redirect.github.com/facebook/relay/commit/4668757a37e9)]: Add back updating-connections to current doc by Tianyu Yao
##### Miscellaneous
- \[[2863820b5000](https://redirect.github.com/facebook/relay/commit/2863820b5000)]: Export fragment type generation for FCL setup by Monica Tang
- \[[4712bcc92e85](https://redirect.github.com/facebook/relay/commit/4712bcc92e85)]: Replace uppercase React import with lowercase one by Sam Zhou
##### Experimental Changes
- \[[cf30bf4a3561](https://redirect.github.com/facebook/relay/commit/cf30bf4a3561)]: Upstream resolvers_schema_module from fb-relay-compiler by Bhuwan Khattar
- \[[05689b07f341](https://redirect.github.com/facebook/relay/commit/05689b07f341)]: Js_module_import_path -> js_module_import_identifier by Bhuwan Khattar
- \[[a2c57d988bc2](https://redirect.github.com/facebook/relay/commit/a2c57d988bc2)]: Consolidate \__relay_model_instance definitions by Monica Tang
- \[[4f7739ac3363](https://redirect.github.com/facebook/relay/commit/4f7739ac3363)]: Generate_schema_resolvers -> ResolversSchemaModule by Bhuwan Khattar
- \[[400090b0ad8a](https://redirect.github.com/facebook/relay/commit/400090b0ad8a)]: Make LiveState and suspenseSentinel top level exports of Relay by Jordan Eldredge
- \[[07a90ee56ab5](https://redirect.github.com/facebook/relay/commit/07a90ee56ab5)]: Repro tests for resolver client edges to nullable models by Monica Tang
- \[[5bbdfc92cd35](https://redirect.github.com/facebook/relay/commit/5bbdfc92cd35)]: Generate rootFragment normalization ast for schema_resolvers by Bhuwan Khattar
- \[[70a5ff0b15c9](https://redirect.github.com/facebook/relay/commit/70a5ff0b15c9)]: Always pass an args object to resolvers that define runtime args by Jordan Eldredge
- \[[3ee60181ff50](https://redirect.github.com/facebook/relay/commit/3ee60181ff50)]: Inject `useFragmentInternal` to use in `useLazyLoadQueryNode` by Andrey Lunyov
- \[[aa64b588fff4](https://redirect.github.com/facebook/relay/commit/aa64b588fff4)]: Unsubscribing from resolvers before removing the record while runing the garbage collector by Leonel Fernandez Mir
- \[[44227353d574](https://redirect.github.com/facebook/relay/commit/44227353d574)]: Validate that field arguments passed to relay resolvers are defined by Monica Tang
- \[[930864a33ede](https://redirect.github.com/facebook/relay/commit/930864a33ede)]: Deprecate verbose resolver syntax with feature flag to enable by Jordan Eldredge
- \[[86dc27050b26](https://redirect.github.com/facebook/relay/commit/86dc27050b26)]: Add regression tests for undefined fragment arguments in relay resolvers by Monica Tang
- \[[00d621701622](https://redirect.github.com/facebook/relay/commit/00d621701622)]: Add regression tests for undefined field arguments in relay resolvers by Monica Tang
- \[[41a33a19331f](https://redirect.github.com/facebook/relay/commit/41a33a19331f)]: Add regression tests for both field and fragment arguments in relay resolvers by Monica Tang
- \[[0c70e547f27b](https://redirect.github.com/facebook/relay/commit/0c70e547f27b)]: Update normalization AST generation by Gerard Moreno-Torres Bertran
### [`v16.0.0`](https://redirect.github.com/facebook/relay/releases/tag/v16.0.0)
[Compare Source](https://redirect.github.com/facebook/relay/compare/v15.0.0...v16.0.0)
##### Breaking
- Arguments passed to the filters keyword for the `@connection` directive will now throw if they are invalid instead of being a no-op. \[[`2dd7954`](https://redirect.github.com/facebook/relay/commit/2dd79543d3f6)]
Flow-related breaking changes:
- Explicit type annotations are no longer needed for `commitMutation` \[[`603ce54`](https://redirect.github.com/facebook/relay/commit/603ce546741a)] and `useMutation` \[[`051e469`](https://redirect.github.com/facebook/relay/commit/051e4694c20b)].
- Records can no longer be modified directly and can only be passed to utility functions such as those in `RelayModernRecord.js`. \[[`21a896c`](https://redirect.github.com/facebook/relay/commit/21a896c54e63)]
- Added the `babel-plugin-syntax-hermes-parser` plugin, which switches Babel to use `hermes-parser` instead of `@babel/parser`, and enables full syntax support for Flow. \[[`c320a89`](https://redirect.github.com/facebook/relay/commit/c320a892482c)]
- \[[`1d95ce2`](https://redirect.github.com/facebook/relay/commit/1d95ce251653)] - Make `React.Element` fully opaque
TypeScript-related breaking changes:
- Empty variables will now be typed as `Record` instead of as `{}` to represent an object without properties. \[[`16910c9`](https://redirect.github.com/facebook/relay/commit/16910c948e9a)] ([#4404](https://redirect.github.com/facebook/relay/issues/4404))
- Nullable fields will now yield a union of the actual type, `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~. \[[`cc47bc9`](https://redirect.github.com/facebook/relay/commit/cc47bc95414b)] ([#4380](https://redirect.github.com/facebook/relay/issues/4380))
- Update: We will leave the feature flag available indefinitely, or until we have an explicit solution to missing data. See [this issue](https://redirect.github.com/facebook/relay/pull/4380#issuecomment-1830284852) for more context.
{
"language": "typescript",
"typescriptExcludeUndefinedFromNullableUnion": true
}
##### Bug Fixes
- \[[`313d62d`](https://redirect.github.com/facebook/relay/commit/313d62d2e96f)] - Don't assign to frozen objects and arrays
- \[[`a5e0ba3`](https://redirect.github.com/facebook/relay/commit/a5e0ba35d72f)] - Fix flow errors
Configuration
📅 Schedule: Branch creation - "before 4am" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
[ ] If you want to rebase/retry this PR, check this box
This PR contains the following updates:
^10.1.3
->^18.0.0
^12.0.0
->^18.0.0
^12.0.0
->^18.0.0
^12.0.0
->^18.0.0
Release Notes
facebook/relay (babel-plugin-relay)
### [`v18.0.0`](https://redirect.github.com/facebook/relay/releases/tag/v18.0.0): Version 18.0.0 Release Notes [Compare Source](https://redirect.github.com/facebook/relay/compare/v17.0.0...v18.0.0) With version 18, the Relay team at Meta and our community of contributors have made several significant improvements to Relay: - Improved validation of argument types - `@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. - Intellisense for your Relay config file - Rename refactoring tools and inlay hints for fragment arguments Read all about them in more detail below: #### Breaking Changes ##### Improved validation of field and fragment arguments 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" } } } #### Major features ##### [@alias](https://redirect.github.com/alias) fragment aliases released as stable 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. **[Read more about @alias](https://relay.dev/docs/next/guides/alias-directive/)** ##### [@catch](https://redirect.github.com/catch) `@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](https://spec.graphql.org/October2021/#sec-Handling-Field-Errors). **[Read more about @catch](https://relay.dev/docs/next/guides/catch-directive/)** ##### [@throwOnFieldError](https://redirect.github.com/throwOnFieldError) `@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](https://spec.graphql.org/October2021/#sec-Handling-Field-Errors). **[Read more about @throwOnFieldError](https://relay.dev/docs/next/guides/throw-on-field-error-directive/)** ##### Semantic Nullability `@throwOnFieldError` unlocks a powerful new feature when combined with a schema that has fields annotated with [`@semanticNonNull`](https://specs.apollo.dev/nullability/v0.2/). `@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](https://relay.dev/docs/next/guides/semantic-nullability/)** ##### Relay Resolvers can now have access to context Thanks for [Mark Polak](https://redirect.github.com/Markionium) and [Drew Atkinson](https://redirect.github.com/drewatk) from Microsoft, [Relay Resolvers](https://relay.dev/docs/next/guides/relay-resolvers/introduction/) can now be configured to accept a shared context object, similar to [standard GraphQL resolvers](https://graphql.org/learn/execution/#root-fields--resolvers). [Pull Request](https://redirect.github.com/facebook/relay/pull/4704) **[Read more about Resolver context](https://relay.dev/docs/next/guides/relay-resolvers/context/)** ##### Ability to opt out of Relay Compiler source control integration 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. [Pull Request](https://redirect.github.com/facebook/relay/pull/4767) #### Editor Integration Improvements Thanks to Tobias Tengler, Relay's [editor support](https://relay.dev/docs/next/editor-support/) now includes: - **Intellisense (autocomplete, hover tooltips, diagnostics) for the Relay config file.** This fills a critical gap since the Relay config is quite under-documented. ([#4724](https://redirect.github.com/facebook/relay/issues/4724)) by tobias-tengler - Editor integration ([#4724](https://redirect.github.com/facebook/relay/issues/4724)) by tobias-tengler - Generate JSON schema for compiler config ([#4723](https://redirect.github.com/facebook/relay/issues/4723)) by Jordan Eldredge - Rename refactoring tools ([#4581](https://redirect.github.com/facebook/relay/issues/4581)) by tobias-tengler - Add Inlay Hints for Fragment arguments ([#4740](https://redirect.github.com/facebook/relay/issues/4740)) by tobias-tengler - Improved documentation links in errors and hover tooltips ([#4741](https://redirect.github.com/facebook/relay/issues/4741)) by tobias-tengler #### Additional runtime logging integrations - \[9b24ad]: Log notify stats by Tianyu Yao - \[ed8a7f]: Add logging for DataChecker by Tianyu Yao - \[462b01]: Add logging for store lookup by Tianyu Yao - \[1faea5]: Add more loggings for GC by Tianyu Yao - \[f42215]: Add more information to execute.next log by Tianyu Yao #### Additional Improvements - \[e84b10]: Inline enum values in hot code paths by Jan Kassens - \[ebd987]: Strictify relay entrypoint typing by Sam Zhou - \[989ebf]: Improve error reporting for argument type errors by Jordan Eldredge - \[3ba54c]: Use more precise variance for some relay types by Sam Zhou - \[9f0e9e]: Improve schema-validation error messaging by Steven Chaitoff - \[eec960]: Report schema parsing errors for synced schema sources ([#4719](https://redirect.github.com/facebook/relay/issues/4719)) by tobias-tengler - \[176f96]: Parallelize dumping schemas to disk by Deepak Singh - \[e492d7]: Fix out of date component name in Mutations & Updates by Lynn Yu - \[0f49c2]: Skip importing export types in TS ([#4754](https://redirect.github.com/facebook/relay/issues/4754)) by Drew Atkinson - \[aba9e9]: Ignore null/undefined queries in entrypoints by Jordan Eldredge - \[d5f1a0]: Correctly report unaliased fragments within inline fragment with [@skip](https://redirect.github.com/skip) by Jordan Eldredge - \[2ad28f]: Disallow Node refetchable query on interfaces without implementations by Tianyu Yao - \[c446d4]: Fix Relay incremental build for enums by Evan Yeung - \[7998bc]: Support multiple [@module](https://redirect.github.com/module) fragments in the same selection if they have [@alias](https://redirect.github.com/alias) ([#4744](https://redirect.github.com/facebook/relay/issues/4744)) by Jordan Eldredge - \[df2aca]: I think we could allow [@module](https://redirect.github.com/module) in the same selection if they have different keys by Jordan Eldredge - \[294cb8]: Ensure we strip alias metadata from selections within inline fragments by Jordan Eldredge - \[531c6f]: Fix syntax error when using the new relay resolver by Tianyu Yao - \[6e47ac]: Return and handle all required_on_non_null_field errors by Gordy French - \[2b5028]: Ensure documents are synced before calculating completions [#4473](https://redirect.github.com/facebook/relay/issues/4473) by Jordan Eldredge - \[c43429]: Add editor support for JSON config schema ([#4724](https://redirect.github.com/facebook/relay/issues/4724)) by tobias-tengler - \[4d2fe9]: Error on multiple graphql type definitions on one flow type by Tianyu Yao - \[99003d]: Prevent using [@alias](https://redirect.github.com/alias) within [@match](https://redirect.github.com/match) by Jordan Eldredge - \[7491d3]: Update relay resolve API doc by Tianyu Yao - \[5d1225]: Fix incremental build when enum field argument changes by Monica Tang - \[0c5d69]: Support incremental schema change for union changes by Lynn Yu - \[d53615]: Refactor alias to always use inline fragments (and compose with other features) by Jordan Eldredge - \[86800e]: Add compiler command to emit json schema of config file by Jordan Eldredge - \[80e041]: Minor spell checking by Gordy French - \[6a2c39]: Validate that [@match](https://redirect.github.com/match) fields always have supported arg by Jordan Eldredge - \[7bd521]: Only validate alias within each selection set by Jordan Eldredge - \[44cbff]: Support Client Edge to Client Union for strong types by Monica Tang - \[d35688]: Avoid reading inline fragments if abstract type condition does not match by Jordan Eldredge - \[3787b8]: Handle case where [@required](https://redirect.github.com/required) bubbles to [@aliased](https://redirect.github.com/aliased) inline fragment on abstract type by Jordan Eldredge - \[349334]: [@required](https://redirect.github.com/required) should bubble nullable to parent semantic-non-null linked field by Gordy French - \[f96121]: Allow abstract inline fragments to be omitted by Daniel Lo Nigro - \[43bd9b]: Revert [`D542067`](https://redirect.github.com/facebook/relay/commit/D54206758): Validate edgeTypeName argument points to an existing type by Amy Hwang #### Documentation Improvements - \[c54830]: Docs for [@catch](https://redirect.github.com/catch) by Itamar Kestenbaum - \[f07f56]: Update semantic nullability docs to remove feature flag that is no-longer needed by Jordan Eldredge - \[861caa]: Fill in definitions for [@stream](https://redirect.github.com/stream) and @stream_connection in Glossary by Lynn Yu - \[e46ba9]: Document current support for experimental semantic nullability ([#4770](https://redirect.github.com/facebook/relay/issues/4770)) by Jordan Eldredge - \[642e03]: Add definitions for [@live](https://redirect.github.com/live) and @live_query to glossary by Lynn Yu - \[27b2a1]: Document resolvers constants by Jordan Eldredge - \[175098]: [@throwOnFieldError](https://redirect.github.com/throwOnFieldError) documentation by Gordy French - \[794cc3]: Pagination documentation fixes by Lynn Yu - \[23a7c2]: Fix the connection key in the mutations tutorial ([#4751](https://redirect.github.com/facebook/relay/issues/4751)) by Sviatoslav Abakumov - \[bf6153]: Fix small errors in docs by Lynn Yu - \[99f4f6]: Organize sidebar for oss site by Evan Yeung - \[0ab687]: Re-organize hierarchy of docs interally by Evan Yeung - \[aa6538]: UseQueryLoader clarification by Monica Tang - \[9f314a]: Fix GraphQL Field name for story thumbnail examples by Jerry Francois - \[285dc2]: Spelling and capitalization by Gordy French - \[0e57c3]: Fix unclosed jsx tag by Monica Tang - \[7fccac]: Fix minor typo in editor-support.md ([#4721](https://redirect.github.com/facebook/relay/issues/4721)) by SY Ryu - \[c632b4]: Link to Relay website [@defer](https://redirect.github.com/defer) [@stream](https://redirect.github.com/stream) docs by Monica Tang - \[d61ce0]: S/class/className/ in MDX ([#4716](https://redirect.github.com/facebook/relay/issues/4716)) by Paul O’Shannessy - \[98d76c]: Add instructions to run relay compiler after query update ([#4718](https://redirect.github.com/facebook/relay/issues/4718)) by Matthew Pawley - \[dbae5c]: Link GQL node definition in useRefetchableFragment section by Danny Zou #### Miscellaneous - \[457e0c]: Update relay compiler README by Monica Tang - \[36e9ea]: Remove loadQuery during render warning ([#4731](https://redirect.github.com/facebook/relay/issues/4731)) by Jordan Eldredge #### Experimental Changes - \[8cb637]: SupportConfiguration
📅 Schedule: Branch creation - "before 4am" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.