What is the corresponding object in GraphQL API v4 for `patch` which is available in REST API v3?

I am trying to get patches of code that were changed in a commit using GraphQL API v4. In the REST API v3 it used to come inside files -> patch and the whole file could be extracted from files -> blob\_url .
How do I get the same information using GraphQL APIs? Which object or node is responsible for giving me this information from GraphQL API?

I have a hunch that it might be the Blob object, but so far it only gives me all the contents of a file object.
Could you please help me figure this out?

Hello @armsp,

Thanks for being here! We’ll do all we can to help. 

We’re not sure about what you’re describing. In order to help us dig a little deeper, could you send an example curl request that you would make to the REST API? Once we have that, we can investigate further.


Hi @nadiajoyce,

Sure, let me give you an example.

  1. Using Rest API v3, we can list the commits for a repository like “elasticsearch” via -


  2. Then lets goto the first commit that we see there by using that commit’s sha -


  3. The result of that query will have quite a handful of information. But we will browse down to files key as that contains information about all the files that were changed in that commit.

  4. In Github we can also see the deletions and additions in that commit from this URL -


And the great thing is, these changes can be accessed via the patch key inside files that I mentioned earlier using Rst API itself.

I want to access these changes or patches as we call them in Rest API v3, using GraphQL API v4. But I haven’t been able to find out how to do that.

Any help would be much appreciated.

Hi @armsp,

Thanks so much for that extra info. Our team has been chatting about this. This info isn’t currently surfaced in v4; however, this in on the team’s radar. I can’t guarantee anything or promise a timeline, but I wanted to let you know that we’re looking at it!