Unable to get query commit in repository.
mou opened this issue · comments
Andrey Larionov commented
Trying to perform this query
query {
repository(owner: "octocat", name: "Hello-world") {
object(oid:"e212ffe458a5f1df7647ee461aff22c7b3a52580") {
... on Commit {
pushedDate
}
}
}
}
For this i use next go code:
var q struct {
Repository struct {
Object struct {
Commit struct {
pushedDate github.DateTime
} `graphql:"... on Commit"`
} `graphql:"object(oid: $sha)"`
} `graphql:"repository(owner: \"octocat\", name: $name)"`
}
variables := map[string]interface{}{
"name": github.String("Hello-World"),
"sha": github.GitObjectID("e212ffe458a5f1df7647ee461aff22c7b3a52580"),
}
err := client.Query(ctx, &q, variables)
In the end i got error:
struct field for "pushedDate" doesn't exist in any of 2 places to unmarshal
Andrey Larionov commented
Sorry. Golang newbie messed up with private declarations