Closed pavelkucera closed 2 years ago
@pavelkucera Hello!
I think replacing +
with plain space should fix the issue in your case as shown here (and it did fix it in my local testing session).
A working version:
{-# LANGUAGE OverloadedStrings #-}
module Main where
import qualified GitHub as GH
main = do
result <- GH.github' (GH.searchIssuesR "repo:haskell-github/github is:pr state:open" (GH.FetchAtLeast 1))
print result
I also believe the existing search examples could be improved further with query that includes various search tags as mentioned in this issue.
@modotte Thank you! You're right, using a space works.
Hi,
I was wondering if you could help me figure out an issue where calling
searchIssuesR
fails when I try to search by multiple conditions (repository / state of a PR). From the outside it looks like there is an issue in howq
gets encoded when passed to GitHub, but I am guessing here.Fails: searching for open PRs in a public repository
I am trying to replicate request such as:
which succeeds (modulo rate limiting)
With code:
which fails with a 422 response from GitHub:
Succeeds: searching for all issues in a public repository
Interestingly, searching for all issues in a public repository succeeds.
Curl:
Code:
This prints issues/PRs of the repository.
How to debug this further?
Since searching just by repository works, but it stops working when I add more conditions, it leads me to believe that
q
doesn't get encoded properly., but it is only a guess. And I'm not quite sure how to debug this further. Would you have any advice?Using
v0.28
of GitHub, and GHC8.10.7
.Thanks for any help!