Relay-compile - using __ generated _ relay requests of a common module
We have a ruby API / graphql engine backend as well as a generic UI module that is reused across applications (both server and client side). Each client application configures usage and extends the module ui
.
In the following case, our client application dummy
(used to test the engine) uses a library ui
that has most of the UI widgets and therefore passes the code (from dummy/src/routes.js
):
// @flow
import React from 'react'
import Route, {makeRouteConfig} from 'found'
import AppFrame from '@alienfast/ui/App/AppFrame'
import {graphql} from 'react-relay'
export default makeRouteConfig (
<Route
component={AppFrame}
query={graphql`
query routes_DummyApp_Query {
current_user {
...AppFrame_currentUser
}
}`
}
/>
)
Mistake:
Command failed `relay-compiler --src ./src --schema ./schema.json`:
Invariant Violation: RelayApplyFragmentArgumentTransform: expected `AppFrame_currentUser` to be a fragment, got `undefined`.
at invariant (/Users/kross/projects/af/spec/dummy/ui/node_modules/fbjs/lib/invariant.js:44:15)
at transformFragmentSpread (/Users/kross/projects/af/spec/dummy/ui/node_modules/relay-compiler/bin/relay-compiler:4874:26)
at /Users/kross/projects/af/spec/dummy/ui/node_modules/relay-compiler/bin/relay-compiler:4936:24
at Array.forEach (native)
at transformSelections (/Users/kross/projects/af/spec/dummy/ui/node_modules/relay-compiler/bin/relay-compiler:4931:15)
at transformField (/Users/kross/projects/af/spec/dummy/ui/node_modules/relay-compiler/bin/relay-compiler:4890:23)
at /Users/kross/projects/af/spec/dummy/ui/node_modules/relay-compiler/bin/relay-compiler:4946:24
at Array.forEach (native)
at transformSelections (/Users/kross/projects/af/spec/dummy/ui/node_modules/relay-compiler/bin/relay-compiler:4931:15)
at transformNode (/Users/kross/projects/af/spec/dummy/ui/node_modules/relay-compiler/bin/relay-compiler:4854:21)
Possibly related:
+3
source to share
No one has answered this question yet
Check out similar questions: