Some fields (like 'merged_at', 'base', 'head') are absent in the search results for pull requests #24491
-
Hi everyone, We are using ‘/search/issues’ API v3 call to get a list of recently changed pull requests: But unlike the ‘/repos///pulls’ API v3 calls the result of the ‘search’ call does not contain some fields, for example, “merged_at”, “head”, “base”. With the ‘search’ call we tried to reduce the traffic to the Github server (we use it instead of getting all available requests with ‘/repos///pulls’). But it seems that we are unable to get all the required information about pull requests with the ‘search’ call. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
@denis-bigbrassband-com: The GraphQL API also exposes a Here’s an example query that searches for all pull requests in the
Result Set
With GraphQL, you can specify the data you need and nothing more: this query only targets five fields per resulting pull request. This kind of configurability is what sets it apart from the REST API’s preconfigured responses. Does this help with what you’re looking to accomplish? |
Beta Was this translation helpful? Give feedback.
-
Hi @francisfuzz, Thank you for the recommendations. |
Beta Was this translation helpful? Give feedback.
-
@denis-bigbrassband-com - Thanks for writing back! I don’t have any official recommendations for a specific Java library to work with our GraphQL API––I suggest opening a new topic in our Programming Help and Discussion category and raising that question there. If it helps as an additional resource, I highly encourage you to check out this GitHub Developer page showcasing Octokit (our official libraries for interfacing with the GitHub API) as well as other third-party libraries. Does that help? |
Beta Was this translation helpful? Give feedback.
-
@francisfuzz |
Beta Was this translation helpful? Give feedback.
@denis-bigbrassband-com: The GraphQL API also exposes a
search
field, whereISSUE
is one of its supported SearchTypes.Here’s an example query that searches for all pull requests in the
github/linguist
repository updated after a certain time (you can modify this example to your liking):Result Set