Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 4

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

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?

3 Replies
Community Manager
Message 2 of 4

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

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.

 

Thanks!

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Copilot Lvl 2
Message 3 of 4

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

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 -
https://api.github.com/repos/elastic/elasticsearch/commits

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

https://api.github.com/repos/elastic/elasticsearch/commits/30c54225611e3c2fc753305ab82ed45061778388

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 -

https://github.com/elastic/elasticsearch/commit/30c54225611e3c2fc753305ab82ed45061778388

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.

Community Manager
Message 4 of 4

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

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!

 

 

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!