【发布时间】:2016-07-29 09:44:36
【问题描述】:
我有一个项目使用 convo GraphQL、Relay 和 Flow。有没有办法使用 GraphQL 模式来提供 Flow,以便在不重新声明类型的情况下键入 React 道具?
对于 Relay,我已经在使用生成两个文件的脚本:schema.json 和 schema.graphql。 Babel 插件使用schema.json 将查询转换为javascript。
另一个文件schema.graphql 看起来与类型的流语法定义相似,但有区别。我已经尝试过一次import type {Definition} from "./schema.graphql",但默默地失败了。
【问题讨论】:
-
我知道没有现成的方式,但我认为你可以自己为它编写 babel-plugin
标签: javascript reactjs graphql flowtype relayjs