【发布时间】:2022-06-01 03:23:52
【问题描述】:
我希望将 dagster Graphql 用作记录在案的here
我想在 repo 中获取所有作业,我正在使用上述文档中概述的“获取存储库中的作业列表”查询
并得到以下错误
{
"error": {
"data": null,
"errors": [
{
"message": "Field \"repositoryOrError\" of type \"RepositoryOrError!\" must have a sub selection.",
"locations": [
{
"line": 2,
"column": 3
}
]
},
{
"message": "Argument \"repositorySelector\" has invalid value {repositoryLocationName: repositoryLocationName, repositoryName: repositoryName}.\nIn field \"repositoryName\": Expected type \"String\", found repositoryName.\nIn field \"repositoryLocationName\": Expected type \"String\", found repositoryLocationName.",
"locations": [
{
"line": 2,
"column": 41
}
]
},
{
"message": "Variable \"$repositoryLocationName\" is never used in operation \"JobsQuery\".",
"locations": [
{
"line": 1,
"column": 17
}
]
},
{
"message": "Variable \"$repositoryName\" is never used in operation \"JobsQuery\".",
"locations": [
{
"line": 1,
"column": 51
}
]
}
]
}
}
我在 python 和 GraphQL Playground 都试过这个
有谁知道我可能哪里出错了?
编辑:
添加给出此错误的python代码:
query1 = """query JobsQuery(
$repositoryLocationName: String!,
$repositoryName: String!
) {
repositoryOrError(
repositorySelector: {
repositoryLocationName: repositoryLocationName,
repositoryName: repositoryName
}
) {
... on Repository {
jobs {
name
}
}
}
}"""
variables = {"repositoryLocationName": "eliaapifetcher", "repositoryName": "elia_api_repo"}
url = 'http://localhost:4200/dagster/graphql'
r1 = requests.post(url, json={'query': query1, 'variables': variables})
【问题讨论】:
-
你好呀!您能否添加一些您尝试过的代码?看起来你可能有一个格式错误的查询,但如果没有看到你的代码就很难说。
-
我已将 python 代码添加到产生错误的帖子中,我在 graphql 操场上也遇到了同样的错误