【发布时间】:2016-02-04 05:26:27
【问题描述】:
我在创建可以使用 babel-relay-plugin 解析而不会出错的 schema.json 文件时遇到问题。查看中继的示例文件夹中包含的schema.json 文件,我尝试在 GraphiQL 中复制查询,但似乎无法正确处理。我使用Laravel 作为后端。这是我可以通过 GraphiQL 完成还是向 GraphQL 端点发送请求并保存响应?
尝试解析 schema.json 文件时出现的错误:
Cannot read property 'reduce' of undefined while parsing file: /Users/username/Sites/Homestead/Code/ineedmg-graphql/resources/assets/js/app.js
上次使用 GraphiQL 的尝试:
{
__schema {
queryType {
name
},
types {
kind,
name,
description,
fields {
name,
description,
type {
name,
kind,
ofType {
name
description
}
}
isDeprecated,
deprecationReason,
},
inputFields {
name
description
}
interfaces {
kind
name
description
},
enumValues {
name
description
isDeprecated
deprecationReason
}
},
mutationType {
name
},
directives {
name,
description,
onOperation,
onFragment,
onField,
args {
name
description
defaultValue
}
}
}
}
【问题讨论】:
标签: reactjs graphql relayjs graphql-js