字段 'history' 上的参数 'since' 具有无效值。预期类型 'GitTimestamp'
Argument 'since' on Field 'history' has an invalid value. Expected type 'GitTimestamp'
我正在使用 Github 的 GraphQL (v4) API 进行一些调用。我正在尝试获取有关存储库的提交信息,但我在定义 Commit
对象的 history
连接的 since
属性时遇到问题。
我收到以下错误:
{
"data": null,
"errors": [
{
"message": "Argument 'since' on Field 'history' has an invalid value. Expected type 'GitTimestamp'.",
"locations": [
{
"line": 38,
"column": 9
}
]
}
]
}
这是导致错误的我的 GraphQL 的提取部分:
query {
search(query:"is:public", type:REPOSITORY, first:10){
edges{
node{
... on Repository{
ref(qualifiedName: "master"){
target{
... on Commit{
history(first: 10, since:"2017-07-15"){
totalCount
pageInfo{
startCursor
endCursor
}
edges{
node{
... on Commit{
committedDate
}
}
}
}
}
}
}
}
}
}
}
}
根据 documentation,GitTimestamp
标量是 ISO-8601 编码的日期字符串。那么,我的字符串 "2017-07-15"
有什么问题呢?我还尝试了以下字符串,none 有效。
- 2017/01/01
- 2017.01.01
- 2017-01-0101:01
- 2017-01-01T01:01
- 2017-01-0101:01Z
- 2017-01-01T01:01Z
您必须以 YYYY-MM-DDTHH:MM:SSZ
格式指定日期。以下将起作用:
- 2017-01-01T01:01:00
- 2017-01-01T01:01:00Z
{
search(query: "is:public", type: REPOSITORY, first: 10) {
edges {
node {
... on Repository {
ref(qualifiedName: "master") {
target {
... on Commit {
history(first: 10, since: "2017-01-01T01:01:00") {
totalCount
pageInfo {
startCursor
endCursor
}
edges {
node {
... on Commit {
committedDate
}
}
}
}
}
}
}
}
}
}
}
}
我正在使用 Github 的 GraphQL (v4) API 进行一些调用。我正在尝试获取有关存储库的提交信息,但我在定义 Commit
对象的 history
连接的 since
属性时遇到问题。
我收到以下错误:
{
"data": null,
"errors": [
{
"message": "Argument 'since' on Field 'history' has an invalid value. Expected type 'GitTimestamp'.",
"locations": [
{
"line": 38,
"column": 9
}
]
}
]
}
这是导致错误的我的 GraphQL 的提取部分:
query {
search(query:"is:public", type:REPOSITORY, first:10){
edges{
node{
... on Repository{
ref(qualifiedName: "master"){
target{
... on Commit{
history(first: 10, since:"2017-07-15"){
totalCount
pageInfo{
startCursor
endCursor
}
edges{
node{
... on Commit{
committedDate
}
}
}
}
}
}
}
}
}
}
}
}
根据 documentation,GitTimestamp
标量是 ISO-8601 编码的日期字符串。那么,我的字符串 "2017-07-15"
有什么问题呢?我还尝试了以下字符串,none 有效。
- 2017/01/01
- 2017.01.01
- 2017-01-0101:01
- 2017-01-01T01:01
- 2017-01-0101:01Z
- 2017-01-01T01:01Z
您必须以 YYYY-MM-DDTHH:MM:SSZ
格式指定日期。以下将起作用:
- 2017-01-01T01:01:00
- 2017-01-01T01:01:00Z
{
search(query: "is:public", type: REPOSITORY, first: 10) {
edges {
node {
... on Repository {
ref(qualifiedName: "master") {
target {
... on Commit {
history(first: 10, since: "2017-01-01T01:01:00") {
totalCount
pageInfo {
startCursor
endCursor
}
edges {
node {
... on Commit {
committedDate
}
}
}
}
}
}
}
}
}
}
}
}