php-github-api icon indicating copy to clipboard operation
php-github-api copied to clipboard

Github\ResultPager doesn't support GraphQL

Open dkarlovi opened this issue 6 months ago • 0 comments

This type of thing could/should work too.

                $response = $pager->fetchAll($this->client->graphql(), 'execute', [
                    'query' => 'query ($login: String!, $perPage: Int!) {
                        user(login: $login) {
                            repositories(first: $perPage, orderBy: {field: UPDATED_AT, direction: DESC}) {
                                nodes {
                                    id
                                }
                                pageInfo {
                                    hasNextPage
                                    endCursor
                                }
                            }
                        }
                    }',
                    'variables' => [
                        'login' => 'torvalds',
                        'perPage' => 10,
                    ],
                ]);

dkarlovi avatar Jun 27 '25 08:06 dkarlovi