Skip to content

Add get_graphql_api function - #1337

Merged
Michael Kovalsky (m-kovalsky) merged 1 commit into
microsoft:mainfrom
iurii-iurchenko-1:iurii-iurchenko-1/get-graphql-api
Oct 4, 2026
Merged

Michael Kovalsky (m-kovalsky) merged 1 commit into
microsoft:mainfrom
iurii-iurchenko-1:iurii-iurchenko-1/get-graphql-api

Conversation

@iurii-iurchenko-1

Copy link
Copy Markdown
Contributor

Adds get_graphql_api, wrapping Items - Get GraphQLApi.

Follows the get_variable_library pattern. Returns a single-row DataFrame with the fields list_graphql_apis doesn't surface — folder, sensitivity label, and default identity — since those are the reason to call get over list.

Testing

Verified in a Fabric notebook against a live workspace, resolving both by name and by item ID:

  • displayName, id, description, folderId return correct values (confirmed folderId by moving the item into a workspace folder)
  • sensitivityLabel and defaultIdentity were absent from the response in my tenant (no Purview/AIP licensing, no identity configured). Both are mapped per the API reference, which documents sensitivityLabel.id — but they are not exercised against populated values. Happy to adjust if the real shape differs.
  • Missing item raises the expected error from resolve_item_id

Formatted with black==25.1.0.

Copilot AI lite review requested due to automatic review settings September 21, 2026 17:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Add the top-level sempy_labs forwarding wrapper and export for consistent public access.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds get_graphql_api to retrieve detailed GraphQL API metadata.

Changes:

  • Implements the Fabric GraphQL API retrieval wrapper.
  • Maps folder, sensitivity label, and default identity fields.
  • Exports the function from the GraphQL submodule.
File Description
src/​sempy_labs/​graphql/​_items.py Implements the API wrapper and response mapping.
src/​sempy_labs/​graphql/​__init__.py Exports get_graphql_api.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/sempy_labs/graphql/__init__.py
@m-kovalsky
Michael Kovalsky (m-kovalsky) merged commit 64f2d8f into microsoft:main Oct 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants