Relay is a JavaScript framework for building data-driven React applications.
MIT License
Bot releases are hidden (Show)
Published by leebyron over 7 years ago
Check it out!
npm install babel-plugin-relay@dev react-relay@dev relay-compiler@dev relay-runtime@dev
Lots of bug fixes, improvements to ease of use and API clarity.
The all new babel plugin: babel-plugin-relay
now handles both modern graphql
literals and classic Relay.QL
literals. The existing babel-relay-plugin
will be deprecated in the future. Configuring babel-plugin-relay
should be easier as it now relies on modern babel conventions.
An example .babelrc file:
{
"plugins": [
["relay", {"schema": "path/to/schema.graphql"}]
]
}
Flow types are now generated inline in the relay-compiler output, so Relay Modern projects can leverage flow typed GraphQL responses. Recently flow types were added to the results of GraphQL mutations as well.
Generated files are now created inline with your source in __generated__
directories. This makes it easier to require the generated files and simplifies configuring the compiler (no more --out
flag).
Support for prototype "live" queries via polling (88d09dcc30f851d8d9abd696d686eb9683b56ba6)
Published by leebyron over 7 years ago
New additions since alpha.1
:
relay-compiler
now comes with a bin of the same name you can run on your codebaseGet Started:
npm install react-relay@dev relay-compiler@dev babel-plugin-relay@dev
Any existing Relay Classic code will need to replace require('react-relay')
with require('react-relay/classic')
.
Published by leebyron over 7 years ago
This is the first public alpha release of Modern Relay. While this release is pretty sparse on details and documentation, we wanted to get code to you soon so you can help us kick the tires and most importantly make sure that your existing apps are still working.
Install react-relay@dev
to get this and future alpha releases.
After installing v1.0.0, existing applications will need to replace require('react-relay')
with require('react-relay/classic')
.
Published by wincent almost 8 years ago
babel-relay-plugin
to use [email protected]
, which supports the latest revision of the GraphQL specification.RelayGraphQLMutation
to public API.rollback
method to RelayGraphQLMutation
.BabelPluginGraphQL
).graphiqlPrinter
argument to the RelayNetworkDebug
constructor that can be used to print a link to view the request in GraphiQL.Published by wincent about 8 years ago
setVariables
, specifically when using array/object variables (closes #1357).Relay.disableQueryCaching
API (closes #754), which may be useful running Relay in a server context.IGNORE
as a rangeBehavior
(closes #1337).RelayQuery.cloneWithRoute
(see commit de954992), making logging and analytics that relies on query names more accurate.RelayNetworkDebug
now prints an estimated request size (see commit b94ba409).callsToGraphQL
/callsFromGraphQL
, fixing issues with null
(closes #1256).injectCacheManager
on RelayEnvironment
(closes #1320).Relay.QueryConfig
(closes #1279).GraphQLRange
get correctly deserialized (closes #1293).errors
attributes and non-200 responses (#1163).client:
ID, necessitating the use of a path when a refetchable ID would be preferable in order to produce a correct result (commit 928411df).Published by steveluscher over 8 years ago
useFakeData
that you can use to silence the warning when using a RelayContainer
with fake data.Relay.QL
string. See https://github.com/facebook/relay/issues/896
RelayStoreData#toJSON
.Published by wincent over 8 years ago
this.props.relay.pendingVariables
which can be used to access variables from in-flight queries (to e.g. display a component-specific loading spinner).npm run update-schema
inside the Relay repo works again.GraphQLQueryRunner
(only relevant to users of the non-public cache manager API).rangeBehaviors
function to allow non-string calls.subtractRelayQuery
is removed.Subscription
nodes.RelayNetworkDebug
is won't do anything unless console.groupCollapsed
is available, because otherwise the output is too noisy to be useful.RelayContainer
now uses more descriptive names for stateless functional components, instead of Relay(props => ReactElement)
.Published by steveluscher over 8 years ago
graphql-js
0.6.0. Developers interestedgraphql-js
0.6.0 might have to make some changes to theirDEV
is true, and console.groupCollapsed
andconsole.groupEnd
are available.this.props.relay
prop passed into components by Relay.Container
nowapplyUpdate
and commitUpdate
methods for dispatching mutationsRelay.Environment
.RANGE_DELETE
mutations can now remove multiple nodes from a connection,deletedIDFieldName
can now point to a plural field.rangeBehaviors
as a function that receives the connectionGraphQLMutatorConstants.RANGE_OPERATIONS
.RelayNetworkDebug#init
now lets you pass in a RelayEnvironment
againstRelayReadyState
now contains an events
array; a stream of events that canRelayReadyStateCallback
. You can reduce over this list ofthis.props.variables
now reflects the variables after being processed withprepareVariables
. The fact that variables were the un-prepared values wasprepareVariables
could be called twice, breakingprepareVariables
functions.setVariables
, orprepareVariables
, that you have not declared ininitialVariables
upfront.stale
prop of a readyState
to change even iferror
present.shouldComponentUpdate: () => boolean
function. If specified, this functionRelayNetworkDebug
now logs query variables.RelayNetworkDebug
is now added as a subscriber instead of replacing anyfetch
.Relay.Environment#injectNetworkLayer
(and, by extensionRelay#injectNetworkLayer
) will now warn if injecting would overwrite aRelayGraphQLMutation
API (still beingPublished by steveluscher over 8 years ago
Relay.Environment
. Relay.Store
is now simply a global instance ofRelayEnvironment
. To create your own isolated store and network subsystem,new RelayEnvironment()
and make use of it wherever environment
Relay.Environment#injectNetworkLayer
to inject a custom network layerRelay.Environment
instance.Relay.ReadyStateRenderer
. This component takes in an instance ofRelay.Environment
, a queryConfig
that conforms to theRelayQueryConfigInterface
, and a Relay container
. It rendersreadyState
. This primitive enables youRelay.Renderer
that fetch and handle data in aRelay.Renderer
– a replacement for Relay.RootContainer
thatRelay.ReadyStateRenderer
and performs data fetching.Relay.RootContainer
is now a wrapper around Relay.Renderer
thatRelay.Store
for environment
.RelayRendererRenderCallback
to RelayRenderCallback
.RelayQueryConfigSpec
to RelayQueryConfigInterface
.RelayContainer.setVariables
will no longer check if the variables aresetVariables
.COMMIT_QUEUED
state usingRelayMutationTransaction#rollback
.NODE_DELETE
or RANGE_DELETE
mutation config, you canparentID
if your parent, in fact, does not have an ID.null
into the store for that field. This allows you tofieldName: null
.relay
prop does not change between renders, we now recycle the samethis.props.relay === nextProps.relay
comparison in shouldComponentUpdate
.friends(first: $first, last: $last)
will no longer cause the Relay Babel plugin to throw).Relay.Mutation
.RelayNetworkDebug
. Invokerequire('RelayNetworkDebug').init(Relay.DefaultNetworkLayer)
to enjoy simplerangeBehaviors
:
IGNORE
means the range should not be refetched at all.REFETCH
will refetch the entire connection.@relay(variables: ['variableNames'])
to a connection fragment.Published by steveluscher over 8 years ago
Published by wincent over 8 years ago
Published by wincent over 8 years ago
Relay.DefaultNetworkLayer
are bound to the instance, facilitating reuse.GraphQL_EXPERIMENTAL
to GraphQL
(internal change).RelayQueryField.getCallType()
when argument is unknown.GraphQLRange
returns diff calls with numeric values instead of strings.Published by wincent over 8 years ago
Relay.DefaultNetworkLayer
constructor to take an init
object instead of fetchTimeout
and retryDelays
.npm run update-schema
to update the test schema.Published by wincent over 8 years ago
Published by wincent over 8 years ago
ReactDOM
rather than React
for performing batched updates (via unstable_batchedUpdates
).__schema
, __typename
and such.field(before: ..., first: ...)
or field(after: ..., last: ...)
is now an error.Published by wincent over 8 years ago
Published by wincent over 8 years ago
babel-relay-plugin
version to v0.2.5.
Published by wincent over 8 years ago
babel-relay-plugin
version to v0.3.0.
node(id: ...)
fields are now invalid.RelayQL
template tag.__typename
of abstract types are now fetched and stored locally.hasOptimisticUpdate
returning true after mutation succeeds (#86).id
fields (#414).__DEV__
-only warning when data is passed down via the wrong prop.Published by wincent over 8 years ago
babel-relay-plugin
version to v0.4.1.
edges
or pageInfo
.
@relay(pattern: true)
.GraphQL
objects).RelayQueryField#getStorageKey
will now produce the same key regardless of the order of a field's arguments.Relay.createQuery()
function which returns a RelayQuery.Root
(that can be used with Relay.Store
methods).