Add ConsistencyLevel header to count guest users sample#1245
Merged
Conversation
Co-authored-by: jasonjoh <8966342+jasonjoh@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add consistency level headers to relevant samples
Add ConsistencyLevel header to count guest users sample
Aug 29, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds the required ConsistencyLevel header to the "count the guest users in your organization" sample query to enable advanced query capabilities for $count operations on Directory Objects.
- Adds missing
ConsistencyLevel: eventualheader to ensure compliance with Microsoft Graph requirements - Aligns the sample with other similar
$countoperations that already include this header - Fixes a functional issue where the query would not work properly without the required header
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
jasonjoh
approved these changes
Aug 29, 2025
MIchaelMainer
approved these changes
Aug 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "count the guest users in your organization" sample was missing the required
ConsistencyLevelheader needed for advanced query capabilities when using$countoperations on Directory Objects.This change adds the missing header to ensure consistency with other similar samples:
The sample now follows the same pattern as other
$countoperations like "count the users in your tenant excluding guests (raw count)" which already had this header. Both samples use/v1.0/users/$countwith filters on user types and require the ConsistencyLevel header according to Microsoft Graph documentation for advanced query capabilities.Fixes #174.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
docs.microsoft.comnode scripts/test-initiator.js --no-watch(dns block)node scripts/test-initiator.js --no-watch --testNamePattern=count the guest users in your organization(dns block)learn.microsoft.comnode scripts/test-initiator.js --no-watch(dns block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.