Data on explorer but 'null' via graphql api endpoint


#1

Hi there

Take this simple query to get an id of an object… asked from this id.

{node(id: "MDExOlB1bGxSZXF1ZXN0MTIwMjAyNjUw") { id }}

This work on the explorer, I get the id back. But actually, this doesn’t work via the api, the same exact call.

I get

{"data":{"node":null}}

without any error.

It’s a pull request. And I have the problem with prs on many repositories, but not all. And other kind of graphql queries work like a charm. (always with the same auth token)

I guess there is something wrong.

Note: I started seeing this error at 9pm utc


Twidi


#2

Hi @twidi, thanks for the report!

Here’s a sample curl request for the query you’ve specified:

curl -v -H "Authorization: bearer TOKEN" -X POST -d '{ "query": "query { node(id:\"MDExOlB1bGxSZXF1ZXN0MTIwMjAyNjUw\") {id}}"}' https://api.github.com/graphql

I get this output:

*   Trying 192.30.255.116...
* TCP_NODELAY set
* Connected to api.github.com (192.30.255.116) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.github.com
* Server certificate: DigiCert SHA2 High Assurance Server CA
* Server certificate: DigiCert High Assurance EV Root CA
> POST /graphql HTTP/1.1
> Host: api.github.com
> User-Agent: curl/7.51.0
> Accept: */*
> Authorization: bearer TOKEN
> Content-Length: 73
> Content-Type: application/x-www-form-urlencoded
> 
* upload completely sent off: 73 out of 73 bytes
< HTTP/1.1 200 OK
< Date: Fri, 12 May 2017 06:55:51 GMT
< Content-Type: application/json; charset=utf-8
< Content-Length: 60
< Server: GitHub.com
< Status: 200 OK
< X-RateLimit-Limit: 200
< X-RateLimit-Remaining: 173
< X-RateLimit-Reset: 1494574953
< Cache-Control: private, max-age=60, s-maxage=60
< Vary: Accept, Authorization, Cookie, X-GitHub-OTP
< ETag: "15c836cfd660d8c68fca7592c0241774"
< X-OAuth-Scopes: admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user
< X-Accepted-OAuth-Scopes: repo
< X-GitHub-Media-Type: github.v3; format=json
< Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
< Access-Control-Allow-Origin: *
< Content-Security-Policy: default-src 'none'
< Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
< X-Content-Type-Options: nosniff
< X-Frame-Options: deny
< X-XSS-Protection: 1; mode=block
< Vary: Accept-Encoding
< X-Served-By: 6694d697f15dfc31f0ffaf8cdb1d5a86
< Vary: Accept-Encoding
< X-GitHub-Request-Id: BAAE:BF68:55FB51:6D6829:59155C77
< 
{"data":{"node":{"id":"MDExOlB1bGxSZXF1ZXN0MTIwMjAyNjUw"}}}
* Curl_http_done: called premature == 0
* Connection #0 to host api.github.com left intact

Could you try running that curl -v request (being sure to substitute TOKEN for your personal access token) and sharing the full output with me so I can take a look? Thanks!


#3

Sorry for not having post the curl example but yes I ran it.

Here it is, for the same request. Something wrong with my tokens ? i tried different ones…

$ curl -v -H "Authorization: bearer TOKEN" -X POST -d '{"query": "{node(id: \"MDExOlB1bGxSZXF1ZXN0MTIwMjAyNjUw\") { id }}"}' https://api.github.com/graphql
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 192.30.253.117...
* Connected to api.github.com (192.30.253.117) port 443 (#0)
* found 173 certificates in /etc/ssl/certs/ca-certificates.crt
* found 696 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
* 	 server certificate verification OK
* 	 server certificate status verification SKIPPED
* 	 common name: *.github.com (matched)
* 	 server certificate expiration date OK
* 	 server certificate activation date OK
* 	 certificate public key: RSA
* 	 certificate version: #3
* 	 subject: C=US,ST=California,L=San Francisco,O=GitHub\, Inc.,CN=*.github.com
* 	 start date: Wed, 18 Jan 2017 00:00:00 GMT
* 	 expire date: Fri, 17 Apr 2020 12:00:00 GMT
* 	 issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert SHA2 High Assurance Server CA
* 	 compression: NULL
* ALPN, server accepted to use http/1.1
> POST /graphql HTTP/1.1
> Host: api.github.com
> User-Agent: curl/7.50.1
> Accept: */*
> Authorization: bearer TOKEN
> Content-Length: 68
> Content-Type: application/x-www-form-urlencoded
> 
* upload completely sent off: 68 out of 68 bytes
< HTTP/1.1 200 OK
< Server: GitHub.com
< Date: Fri, 12 May 2017 11:55:22 GMT
< Content-Type: application/json; charset=utf-8
< Content-Length: 23
< Status: 200 OK
< X-RateLimit-Limit: 200
< X-RateLimit-Remaining: 105
< X-RateLimit-Reset: 1494591171
< Cache-Control: private, max-age=60, s-maxage=60
< Vary: Accept, Authorization, Cookie, X-GitHub-OTP
< ETag: "c9a972720f73f6d62fd365d72dd12c1a"
< X-OAuth-Scopes: repo
< X-Accepted-OAuth-Scopes: repo
< X-OAuth-Client-Id: a0c60cf066645ee73a87
< X-GitHub-Media-Type: github.v3; format=json
< Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
< Access-Control-Allow-Origin: *
< Content-Security-Policy: default-src 'none'
< Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
< X-Content-Type-Options: nosniff
< X-Frame-Options: deny
< X-XSS-Protection: 1; mode=block
< Vary: Accept-Encoding
< X-Served-By: eef8b8685a106934dcbb4b7c59fba0bf
< X-GitHub-Request-Id: A426:34FA:892D089:B8E9B53:5915A2AA
< 
{"data":{"node":null}}

I hope you can find something with this!

Thanks a lot!


#4

Hey @twidi - thanks for that output! I’ve asked the team to investigate this more in an internal issue. I’ll be sure to write back when I hear more from them!


#5

Hi there @twidi !

We noticed that you’re using curl version 7.5.0. The curl output that I sent over uses version 7.5.1. Could you try upgrading your version of curl to 7.5.1 and see if the behavior you’re seeing still persists?


#6

Hum it’s kind of complicated. What is missing from the current output? Note that I have this problem not only via curl but via calls using python .


#7

I found a way to easily install the 7.52.1 and still have the same result.

$ curl -v -H "Authorization: bearer TOKEN" -X POST -d '{"query": "{node(id: \"MDExOlB1bGxSZXF1ZXN0MTIwMjAyNjUw\") { id }}"}' https://api.github.com/graphql
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 192.30.253.116...
* TCP_NODELAY set
* Connected to api.github.com (192.30.253.116) port 443 (#0)
* found 173 certificates in /etc/ssl/certs/ca-certificates.crt
* found 696 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
* 	 server certificate verification OK
* 	 server certificate status verification SKIPPED
* 	 common name: *.github.com (matched)
* 	 server certificate expiration date OK
* 	 server certificate activation date OK
* 	 certificate public key: RSA
* 	 certificate version: #3
* 	 subject: C=US,ST=California,L=San Francisco,O=GitHub\, Inc.,CN=*.github.com
* 	 start date: Wed, 18 Jan 2017 00:00:00 GMT
* 	 expire date: Fri, 17 Apr 2020 12:00:00 GMT
* 	 issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert SHA2 High Assurance Server CA
* 	 compression: NULL
* ALPN, server accepted to use http/1.1
> POST /graphql HTTP/1.1
> Host: api.github.com
> User-Agent: curl/7.52.1
> Accept: */*
> Authorization: bearer TOKEN
> Content-Length: 68
> Content-Type: application/x-www-form-urlencoded
> 
* upload completely sent off: 68 out of 68 bytes
< HTTP/1.1 200 OK
< Server: GitHub.com
< Date: Sat, 13 May 2017 00:24:37 GMT
< Content-Type: application/json; charset=utf-8
< Content-Length: 23
< Status: 200 OK
< X-RateLimit-Limit: 200
< X-RateLimit-Remaining: 198
< X-RateLimit-Reset: 1494638413
< Cache-Control: private, max-age=60, s-maxage=60
< Vary: Accept, Authorization, Cookie, X-GitHub-OTP
< ETag: "c9a972720f73f6d62fd365d72dd12c1a"
< X-OAuth-Scopes: repo
< X-Accepted-OAuth-Scopes: repo
< X-OAuth-Client-Id: a0c60cf066645ee73a87
< X-GitHub-Media-Type: github.v3; format=json
< Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
< Access-Control-Allow-Origin: *
< Content-Security-Policy: default-src 'none'
< Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
< X-Content-Type-Options: nosniff
< X-Frame-Options: deny
< X-XSS-Protection: 1; mode=block
< Vary: Accept-Encoding
< X-Served-By: 15bc4ab707db6d6b474783868c7cc828
< X-GitHub-Request-Id: CB20:34F9:91D2E0B:C4383D8:59165245
< 
{"data":{"node":null}}

#8

Hey @twidi - thanks for giving that a try! I’ve asked our team internally to take another look at this. I don’t have an ETA for when they’ll get back, but I’ll ping you again when I hear more from them.


#9

@francisfuzz It seems to work again! I didn’t change anything, so thanks for the work of the Github teams :wink:


#10

Mysterious! I was messing around with some authorization stuff, so I hope that did the trick.

To be honest I was stumped and totally unable to replicate the issue. So…you’re…welcome? :joy: