我们有一个后端ruby API / graphql引擎,以及在不同应用程序(服务器端和客户端端)中重用的共享UI模块。每个客户端应用程序都会自定义使用并扩展ui
模块。
在以下情况中,我们的dummy
客户端应用程序(用于测试引擎)使用ui
库,该库具有大部分UI小部件,因此中继代码(来自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
}
}`
}
/>
)
错误:
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)
可能相关: