I suspect that both are not real-time but somehow cached.
Does anybody know? I can’t find this in the document.
Let me elaborate a little bit:
I have a service that subscribed to a repo’s webhook event.
When a push event is coming in, I then query GitHub through REST V3 / GraphQL v4.
To my surprise that the service failed to retrieve info from either REST or GraphQL (Get PR # from commitSHA).
I then added a sleep(1s) in my service, this time it works.
Thus lead to the question above.
Hi @louisluhao,
Thanks for writing in about this, I’m sharing the reply from our support team as it might be helpful to another user with a similar concern. In the meantime, we’re looking forward to seeing you around!
“API queries should be real time. However, it sounds like there was a required background job needed to update the merge_commit_sha
and you happen to run the query before it was completed. Therefore you were unable to obtain the data, but when you added the sleep
, the job was finished and gave you a response.”