src-cli doesn't accept numeric arguments
Running the following command:
echo 'query DependencyReferences($repoPath: String!, $commitID: String!, $filePath: String!, $mode: String!, $line: Int!, $character: Int!) {
repository(uri: $repoPath) {
commit(rev: $commitID) {
file(path: $filePath) {
dependencyReferences(Language: $mode, Line: $line, Character: $character) {
repoData {
repos {
id
uri
lastIndexedRevOrLatest {
oid
}
}
repoIds
}
}
}
}
}
}
' | src api 'repoPath=github.com/gorilla/mux' 'commitID=cb4698366aa625048f3b815af6a0dea8aef9280a' 'mode=go' 'filePath=mux.go' 'line=23' 'char=5'
Returns:
{
"data": {
"repository": {
"commit": {
"file": {}
}
}
},
"errors": [
{
"message": "could not unmarshal \"23\" (string) into int32: incompatible type"
}
]
}
Is there a way to specify types for args?
(not urgent, just noticed this while working on https://github.com/sourcegraph/sourcegraph/issues/11753)
I agree this looks like an oversight/bug and should be possible.
One immediate workaround is to use the -vars flag to pass JSON variables. e.g.
echo ... | src api -vars '{"repoPath":"github.com/gorilla/mux", "commitID":"cb4698366aa625048f3b815af6a0dea8aef9280a", "mode":"go", "filePath":"mux.go", "line": 23, "char": 5}'
Nice, missed that option!
This issue has not had any recent activity. To keep our open issue list representative of our actual priorities, it will be closed if no further activity occurs. If this issue should stay open, simply remove the stale label. Thank you for your contributions.
This issue has not had any recent activity. To keep our open issue list representative of our actual priorities, it will be closed if no further activity occurs. If this issue should stay open, simply remove the stale label. Thank you for your contributions.