microsoftgraph / microsoftgraph/msgraph-sdk-php
The `top` and `filter` query parameters do not work together
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 669
- Forks
- 150
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 3
Description
When the filter and top query parameters are both set, the top parameter appears to be ignored. The following script echoes 1000 . This appears to be the maximum allowed page size.
When the filter parameter is removed, the script echoes 10 - as expected.
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Users\UsersRequestBuilderGetRequestConfiguration;
$tokenRequestContext = new ClientCredentialContext(
'tenant_id',
'client_id',
'client_secret'
);
$graphServiceClient = new GraphServiceClient($tokenRequestContext);
$queryParameters = UsersRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->filter = "signInActivity/lastSignInDateTime ge 2024-01-01T00:00:00Z";
$queryParameters->top = 10;
$requestConfiguration = new UsersRequestBuilderGetRequestConfiguration();
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->users()->get($requestConfiguration)->wait();
echo count($result->getValue());
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the script with UsersRequestBuilderGetRequestConfiguration, comparing the generated request when filter and top are used together with the request using top alone. Trace how the Users request query parameters are serialized and verify whether the service or SDK drops top. Done means the combined request honors top=10, or the issue is documented as an upstream service limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100