-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: Different result from a graphql postman request than from a github action/ github explorer graphql #276
Comments
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with |
[UPDATE]: This seems to be a token issue. I tried (and it was a pain) to use curl with my PAT to make the graphql request and it gave me the right result... here is the curl command, with obsfucated PAT, REPO and ORGANISATION, and the result : curl -X POST https://api.github.com/graphql -H "Content-Type: application/json" -H "Authorization: Bearer PAT" -d '{"query": "query { organization(login: \"ORGANISATION\") { repository(name: \"REPO\", followRenames: true) { pullRequest(number: 39) { body commits(first: 100) { nodes { commit { message } } } } projectsV2(first: 1) { totalCount nodes { number } } } } }"}' | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1390 100 1132 100 258 1668 380 --:--:-- --:--:-- --:--:-- 2050
{
"data": {
"organization": {
"repository": {
"pullRequest": {
"body": "",
"commits": {
"nodes": [
{
"commit": {
"message": "Update auto_move_tickets.yml"
}
},
{
"commit": {
"message": "Update auto_move_tickets.yml"
}
},
{
"commit": {
"message": "Update auto_move_tickets.yml"
}
},
{
"commit": {
"message": "Update auto_move_tickets.yml"
}
},
{
"commit": {
"message": "Update auto_move_tickets.yml"
}
},
{
"commit": {
"message": "Update auto_move_tickets.yml"
}
},
{
"commit": {
"message": "Update auto_move_tickets.yml"
}
},
{
"commit": {
"message": "Update auto_move_tickets.yml"
}
},
{
"commit": {
"message": "Update auto_move_tickets.yml"
}
},
{
"commit": {
"message": "nouveau test"
}
},
{
"commit": {
"message": "correction"
}
},
{
"commit": {
"message": "re correction?"
}
},
{
"commit": {
"message": "re correction encore ?"
}
},
{
"commit": {
"message": "test"
}
},
{
"commit": {
"message": "Retest"
}
},
{
"commit": {
"message": "re"
}
},
{
"commit": {
"message": "re correction"
}
},
{
"commit": {
"message": "Nouvelle correction"
}
},
{
"commit": {
"message": "Nouvelles datas à lire"
}
},
{
"commit": {
"message": "rerererere"
}
},
{
"commit": {
"message": "rerererererere"
}
},
{
"commit": {
"message": "nouvelles infos"
}
}
]
}
},
"projectsV2": {
"totalCount": 1,
"nodes": [
{
"number": 7
}
]
}
}
}
}
} And, after configuring (with pain, again) GitHub CLI to use my PAT instead of the default generated token (with no modifyable scope), the command works fine with GitHub CLI : gh api graphql -f query='query { organization(login: "ORGANISATION") { repository(name: "REPO", followRenames: true) { pullRequest(number: 39) { body commits(first: 100) { nodes { commit { message } } } } projectsV2(first: 1) { totalCount nodes { number } } } } }'
{
"data": {
"organization": {
"repository": {
"pullRequest": {
"body": "",
"commits": {
"nodes": [
{
"commit": {
"message": "Update auto_move_tickets.yml"
}
},
{
"commit": {
"message": "Update auto_move_tickets.yml"
}
},
{
"commit": {
"message": "Update auto_move_tickets.yml"
}
},
{
"commit": {
"message": "Update auto_move_tickets.yml"
}
},
{
"commit": {
"message": "Update auto_move_tickets.yml"
}
},
{
"commit": {
"message": "Update auto_move_tickets.yml"
}
},
{
"commit": {
"message": "Update auto_move_tickets.yml"
}
},
{
"commit": {
"message": "Update auto_move_tickets.yml"
}
},
{
"commit": {
"message": "Update auto_move_tickets.yml"
}
},
{
"commit": {
"message": "nouveau test"
}
},
{
"commit": {
"message": "correction"
}
},
{
"commit": {
"message": "re correction?"
}
},
{
"commit": {
"message": "re correction encore ?"
}
},
{
"commit": {
"message": "test"
}
},
{
"commit": {
"message": "Retest"
}
},
{
"commit": {
"message": "re"
}
},
{
"commit": {
"message": "re correction"
}
},
{
"commit": {
"message": "Nouvelle correction"
}
},
{
"commit": {
"message": "Nouvelles datas à lire"
}
},
{
"commit": {
"message": "rerererere"
}
},
{
"commit": {
"message": "rerererererere"
}
},
{
"commit": {
"message": "nouvelles infos"
}
}
]
}
},
"projectsV2": {
"totalCount": 1,
"nodes": [
{
"number": 7
}
]
}
}
}
}
} My questions are now those ones :
|
What happened?
I'm trying to get (not only, but that's part of the process) the number of the project associated with the repository from which pull request occurs. To do so, I found out that I need to use graphql requests. So I tested my queries first on Postman... And I happily found a way (yay). But, when I try to get the same result from github actions or explorer, the result is always empty on the fields that matters in this discussion and it's driving me crazy.
The repository is part of an organization but :
Here's the query
Here is the yaml for the github actions
(in case you wonder : it's just for test currently and the echo doesnt work BUT i can read the object supposed to be echoed in the log error, so it's fine ^^)
Then, here is the result from such command with a PAT with Postman
And there is the result from github action using the token generated by github action ITSELF.
And I have the same problem with github explorer...
Can someone help ? T.T
Versions
2.0.1
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: