- Relay 16.2.0, see:
- Relay 15.0.0, see: https://github.com/facebook/relay/releases/tag/v15.0.0
- The deprecated
QueryRenderer
has been removed. You should use appropriate Relay hooks alternatives. - Dependency on
@adeira/fetch
has been removed which means:- errors
FetchResponseError
andFetchTimeoutError
are no longer being exported from the package - function
createNetworkFetcher
no longer acceptsfetchTimeout
andretryDelays
config options
- errors
- Relay 14.1.0, see: https://github.com/facebook/relay/releases/tag/v14.1.0
- The network layer now takes
QueryResponseCache
into account. - Add experimental
RelayRehydratePreloadedQueries
query to allow usage ofusePreloadedQuery
in Next.js applications.
- Use Relay 14.0.0, see: https://github.com/facebook/relay/releases/tag/v14.0.0
- Removed old
LocalQueryRenderer
,createLocalEnvironment
andgetDataFromRequest
- Use Relay 13.1.0, see: https://github.com/facebook/relay/releases/tag/v13.1.0
- Use Relay 13.1.1, see: https://github.com/facebook/relay/releases/tag/v13.1.1
- Use Relay 13.2.0, see: https://github.com/facebook/relay/releases/tag/v13.2.0
- Added support for
@live_query
directive.
- Use Relay 13.0.2, see: https://github.com/facebook/relay/releases/tag/v13.0.2
- Relay 13, see: https://github.com/facebook/relay/releases/tag/v13.0.0
- The old Relay Compiler wrapper has been replaced with the new Rust Compiler. This is the only compiler available in Relay 13+ and you can read more about this change here: https://relay.dev/blog/2021/12/08/introducing-the-new-relay-compiler/
- Binary
adeira-fetch-schema
has been removed. Fetching of the GraphQL schema is not responsibility of this package anymore. - Added logging of required fields (
@required(action:LOG)
directive).
-
Breaking: Relay version upgraded to 12.0.0, for more information please visit: https://github.com/facebook/relay/releases/tag/v12.0.0
-
Breaking: All previous loggers (
RelayEagerLogger
,RelayLazyLogger
andRelayDebugLogger
) were replaced with one simpleRelayLogger
. This allows us to focus better on one solution that is more friendly with the new Relay Hooks development workflow. -
Breaking: function
commitMutationAsync
has been removed. You can still use legacycommitMutation
or preferablyuseMutation
hook which is much better replacement for these functions. -
Breaking: types
PaginationRelayProp
andRefetchRelayProp
were renamed toRelayPaginationProp
andRelayRefetchProp
respectively. Additionally, they now expect component instead of props type in the generic type (that applies toRelayProp
type as well). Migration example:- }): FragmentContainerType<Props>); + }): RelayFragmentContainer<typeof DefaultComponent>); - ): PaginationContainerType<Props>); + ): RelayPaginationContainer<typeof DefaultComponent>); - ): RefetchContainerType<Props>); + ): RelayRefetchContainer<typeof DefaultComponent>);
-
Breaking: new version of
fetchQuery
from Relay 11 (returns observable instead of promise). For more information please visit: https://github.com/facebook/relay/releases/tag/v11.0.0. Easiest migration path (BUT be aware of the limitations):- await fetchQuery(environment, query, variables); + await fetchQuery(environment, query, variables).toPromise();
- Added support for GraphQL errors with
CRICITAL
severity: you can mark any error to be critical by adding this value toerrors[*].extensions.severity
. Such errors will be propagated to any availableErrorBoundary
when usinguseLazyLoadQuery
or toonError
callback when calling a mutation. - Removed forgotten dependency
relay-compiler-experimental
(followup after 3.2.4) - Bump commander from from 7.2.0 to 8.0.0
- Export type
PreloadedQuery
that is handy when usingusePreloadedQuery
hook for example.
- Removed experimental bin
adeira-relay-compiler-experimental
because it was causing issues when installing@adeira/relay
via NPM (see adeira/universe#2328). If you want to use the new Relay Rust Compiler please install it directly viarelay-compiler-experimental
(https://www.npmjs.com/package/relay-compiler-experimental).
Note for all Flow users: all projects in adeira/universe
now use implicit exact Flow types ({}
for strict objects and { ... }
for open objects, syntax {||}
is deprecated). We do not expect any issues as long as you are using exact_by_default=true
Flow option.
- Relay dependencies upgraded to version 11.0.2, see: https://github.com/facebook/relay/releases/tag/v11.0.2
- experimental Relay Rust compiler upgraded to the latest
master
version
- Added experimental bin
adeira-relay-compiler-experimental
which directly calls officialrelay-compiler-experimental
bin. This new Relay compiler written in Rust is unstable (as the name suggests) but eventually will be the default. For now, you can start experimenting with it and report any issues tofacebook/relay
repo.
- Relay dependencies upgraded to version 11.0.1, see: https://github.com/facebook/relay/releases/tag/v11.0.1
This minor release is focused on cleaning old internal code and removing some legacy parts of the library. The goal is to have a clean and stable version before eventually removing the container API (and keeping only hooks API). But don't worry yet - we follow upcoming Relay releases.
- removed required
X-Client
HTTP header fromcreateNetworkFetcher
(you can still use it but it's no longer mandatory) - relax signature verification when using
adeira-relay-compiler
- it no longer requires the signature but still verifies it if it exists - script
adeira-fetch-schema
now reads schema path fromrelay.config.js
file (it still supports--filename
for backward compatibility but that will be eventually removed) - removed dependency on
@adeira/logger
- fixes a Flow issue when using
@refetchable
(useRefetchableFragment
hook), see: adeira/universe#1975
This release introduces Relay Hooks in a backward compatible fashion. Next major version of @adeira/relay
will focus on phasing out legacy parts of Relay Modern (containers API), so it's highly encouraged to upgrade as soon as possible, see: facebook/relay#3371
- Relay dependencies upgraded to version
11.0.0
, see: https://github.com/facebook/relay/releases/tag/v11.0.0 - Additional Relay hooks were exposed:
useEntryPointLoader
,useFragment
,useLazyLoadQuery
,usePaginationFragment
,usePreloadedQuery
,useQueryLoader
,useRefetchableFragment
,useSubscribeToInvalidationState
anduseSubscription
(+ some other hooks specific functions) - Packages
@adeira/relay-runtime
and@adeira/relay-utils
merged to this package. Everything should work without any extra changes (except for updating the exports). Please, let us know in case we missed something.
For more information about Relay Hooks evolution please visit the following links:
- https://github.com/facebook/relay/releases/tag/v11.0.0
- https://relay.dev/blog/2021/03/09/introducing-relay-hooks/
- https://relay.dev/docs/ (new)
- facebook/relay#3371
adeira-fetch-schema
script fixed
- Support for Node.js 12 has been removed. This package might continue working on older Node.js versions, however, it's highly recommended upgrading to Node.js version 14 or newer. For more details, see: https://nodejs.org/en/about/releases/, or discuss here: adeira/universe#1588
- Use
RelayLazyLogger
instead ofRelayEagerLogger
by default.
- Upgraded Relay to version 10.1.0, see: https://github.com/facebook/relay/releases/tag/v10.1.0
- Change to use the new JSX transforms
-
Added new Flow utils
FragmentContainerType
,RefetchContainerType
andPaginationContainerType
which will help you to migrate to the newtypes-first
Flow architecture (https://medium.com/flow-type/types-first-a-scalable-new-architecture-for-flow-3d8c7ba1d4eb). Example:import { createFragmentContainer, graphql, type FragmentContainerType } from '@adeira/relay'; // ... export default (createFragmentContainer(Location, { location: graphql` fragment Location_location on Location { name country } `, }): FragmentContainerType<Props>);
- Upgrade relay to 10.0.1
- Remove
handlerProvider
fromcreateEnvironment
, leaving the default fromreact-relay
to be used if the consumer doesn't add one.
- Upgrade relay to 10.0.0
QueryRenderer
types defined as generic
- Replace
readInline
function withreact-relay
implementation.
- Upgrade relay packages to 9.1.0
- Remove record proxy type
- Import record proxy type from
@adeira/relay-runtime
- Upgrade
babel-plugin-relay
dependency
- Export
useMutation
from index.js
- Relay upgraded to the latest version 7.0.0 (see: https://github.com/facebook/relay/releases/tag/v7.0.0)
- Old Relay logger has been replaced with new event-based logger.
- Removed all custom Relay Compiler validations.
- Improve
RefetchOptions
type
- Improved flow type coverage of Relay store.
- Compiler: added
include
andexclude
arg options.
- Fixed Flow types for
createFragmentContainer
,createPaginationContainer
andcreateRefetchContainer
. This may yield many new errors especially if you didn't type your React components correctly. But don't worry, the upgrade can be very simple and automated - contact us directly. :) - Compiler: added support for experimental FS persist mode (see Relay Example project).
- Function
commitMutation
is now defined with generic Flow type. You can now use types generated by Relay compiler:commitMutation<NamedMutation>(...)
. - New experimental function
commitMutationAsync
added - this function is the same likecommitMutation
except it returns Promise.
- Burst cache timeout changed to 2 seconds.
- Added invariant check for correct container factories usages.
- Added support for
readInlineData
(should be combined with@inline
, see: https://relay.dev/docs/en/graphql-in-relay.html#inline). - Export
DeclarativeMutationConfig
Flow type.
- Expose new experimental
RelayEnvironmentProvider
component anduseRelayEnvironment
hook.
- Added typed
fetchQuery
to the public interface (see: https://relay.dev/docs/en/fetch-query)
- Breaking: Relay upgraded to the latest version 6.0.0 (see: https://github.com/facebook/relay/releases/tag/v6.0.0). We also added Flow interface for the new
LocalQueryRenderer
(with newcreateLocalEnvironment
) but please remember that this interface is currently experimental and doesn't have the same capabilities like ourQueryRenderer
. The interface is not finished yet and it may change in the future. - Breaking: Direct usage of
relay-compiler
is no longer officially supported. Usekiwicom-relay-compiler
instead.
- Enable
--watch
mode in our experimental Relay compiler. - Enable
--validate
mode in our experimental Relay compiler. This mode returns code101
in case of outdated generated files. - Relay compiler now outputs ES6 modules.
- Added support for official Relay package
relay-config
which allows you to centralize Relay configuration in files likerelay.config.js
. Example:
module.exports = {
// ...
// Configuration options accepted by the `relay-compiler` command-line tool and `babel-plugin-relay`.
src: './src',
schema: './data/schema.graphql',
exclude: ['**/node_modules/**', '**/__mocks__/**', '**/__generated__/**'],
};
- Experimental Relay compiler now shows warnings when you access deprecated field in your application code.
- Script
kiwicom-fetch-schema
now signs the generated files and sorts fields lexicographically. - Experimental Relay compiler now verifies the signature generated by
kiwicom-fetch-schema
.
- This version contains upgraded dependencies and more accurate Flow types.
- New QueryRenderer property
dataFrom
with valuesSTORE_THEN_NETWORK
andNETWORK_ONLY
(more info here: https://relay.dev/docs/en/next/query-renderer#props). - Many internal updates mostly targeting OSS development experience.
- New bin script
kiwicom-fetch-schema
available. This little script helps you with the download of your remote schema. Please, read README file to see how to use it.
- Flow types of some object types are now more accurate
- Reverted breaking change enforcing correct Environment usage from version 3.0.0
- (reverted in 0.3.1.0) Breaking: functions
commitMutation
,requestSubscription
andcommitLocalUpdate
now require correct usage of Relay environment which is being passed down from props. Example of how to properly use mutations:
import {
type RelayProp, // or `PaginationRelayProp` or `RefetchRelayProp` types
} from '@adeira/relay';
type Props = {| +relay: RelayProp |};
function Component(props: Props) {
useEffect(() => {
commitMutation(
props.relay.environment, // <<< this Environment is not being imported but rather reused from `props.relay`
{ mutation: graphql` ... ` },
);
});
}
- Relay updated to version 5.0, see: https://github.com/facebook/relay/releases/tag/v5.0.0
- This release also contains new experimental Relay Compiler with support for persistent queries. This is currently undocumented feature and you should not use it. Expect breaking changes without any announcements.
- You can now pass custom GraphiQL Printer into Relay environment factory. There is a default printer enabled for https://graphql.kiwi.com/ - you can just click on the GraphiQL link in your dev console and it will open current query with variables so you can debug it easily.
- Experimental Flow support for operation loader (needed for
@match
and@module
).
- Babel Relay preset is now part of this package. Removed from
@adeira/babel-preset-adeira
in version 3.0.0. Please, edit your Babel configuration files (example for Next.js applications):
module.exports = {
presets: ['@adeira/babel-preset-adeira', 'next/babel'],
plugins: ['relay'],
};
- Upgraded to Relay version 4.0.0 (see: https://github.com/facebook/relay/releases/tag/v4.0.0). Our previous versions 1.x disallowed some deprecated usages of Relay so this upgrade should be relatively straightforward. Check new testing tools in this release - especially
MockPayloadGenerator
andRelayMockEnvironment
. There is also an improved support for@match
/@module
directives (available from@adeira/relay
version 1.0) which works well with@adeira/babel-preset-adeira
from version 3.0. Please give it a try and give us your feedback.
- Network fetcher now accepts optional
refetchConfig
to be able to adjustfetchTimeout
andretryDelays
(see for more details: https://github.com/kiwicom/fetch)
Disposable
Flow type exposed publiclyEnvironment
(incomplete) Flow type exposed publicly