kowainik / github-graphql

🕸️ GraphQL bindings to GitHub API
https://kowainik.github.io/projects/github-graphql
Mozilla Public License 2.0
7 stars 0 forks source link

Test that calling API works #19

Closed chshersh closed 3 years ago

chshersh commented 3 years ago

I realized, that with current types it's a bit hard to test, and will require a bit of work...

I propose to use the following query to write the test, because the output of this query won't change with time:

query { 
  repository(owner: "kowainik", name: "hit-on") {
    issues(last: 2, states: [CLOSED], orderBy: {field: CREATED_AT, direction: DESC}) {
        nodes {
          title
          author{
            login
          }
        }  
    }
  }
}

The output looks like this:

{
  "data": {
    "repository": {
      "issues": {
        "nodes": [
          {
            "title": "Implement \"git-new\"-like command: `hit hop`",
            "author": {
              "login": "chshersh"
            }
          },
          {
            "title": "Implement basic CLI interface",
            "author": {
              "login": "vrom911"
            }
          }
        ]
      }
    }
  }
}

For this we need to do the following: