Pagination in search query does not work


#1

It seems that the first and after arguments is not taking effect.

For example, the query below is returning 10 repositories not 2 as passed in the first argument.

And if I try to paginate the result using after with the endCursor, it returns the same nodes of the first page.

{
  search(query: "GraphQL", type: REPOSITORY, first: 2) {
    repositoryCount
    pageInfo {
      startCursor
      endCursor
      hasNextPage
      hasPreviousPage
    }
    edges {
      node {
        ... on Repository {
          name
          url
          stargazers {
            totalCount
          }
        }
      }
    }
  }
}

The result:

{
  "data": {
    "search": {
      "repositoryCount": 2710,
      "pageInfo": {
        "startCursor": "MQ==",
        "endCursor": "MTA=",
        "hasNextPage": true,
        "hasPreviousPage": false
      },
      "edges": [
        {
          "node": {
            "name": "graphql",
            "url": "https://github.com/facebook/graphql",
            "stargazers": {
              "totalCount": 3921
            }
          }
        },
        {
          "node": {
            "name": "graphql",
            "url": "https://github.com/graphql-go/graphql",
            "stargazers": {
              "totalCount": 819
            }
          }
        },
        {
          "node": {
            "name": "graphql",
            "url": "https://github.com/graphql-elixir/graphql",
            "stargazers": {
              "totalCount": 556
            }
          }
        },
        {
          "node": {
            "name": "GraphQL",
            "url": "https://github.com/Youshido/GraphQL",
            "stargazers": {
              "totalCount": 223
            }
          }
        },
        {
          "node": {
            "name": "GraphQL",
            "url": "https://github.com/GraphQLSwift/GraphQL",
            "stargazers": {
              "totalCount": 193
            }
          }
        },
        {
          "node": {
            "name": "graphql",
            "url": "https://github.com/tmc/graphql",
            "stargazers": {
              "totalCount": 40
            }
          }
        },
        {
          "node": {
            "name": "graphql",
            "url": "https://github.com/asonge/graphql",
            "stargazers": {
              "totalCount": 87
            }
          }
        },
        {
          "node": {
            "name": "graphql-js",
            "url": "https://github.com/graphql/graphql-js",
            "stargazers": {
              "totalCount": 5089
            }
          }
        },
        {
          "node": {
            "name": "awesome-graphql",
            "url": "https://github.com/chentsulin/awesome-graphql",
            "stargazers": {
              "totalCount": 2546
            }
          }
        },
        {
          "node": {
            "name": "graphql",
            "url": "https://github.com/sevki/graphql",
            "stargazers": {
              "totalCount": 31
            }
          }
        }
      ]
    }
  }
}

Is that a bug or I’m using it in a wrong way?