[APIM] az apim graphql resolver: Add update command#33481
[APIM] az apim graphql resolver: Add update command#33481danakim1004au-prog wants to merge 1 commit into
Conversation
️✔️AzureCLI-FullTest
|
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| apim graphql resolver update | cmd apim graphql resolver update added |
|
Thank you for your contribution @danakim1004au-prog! We will review the pull request and get back to you soon. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds support for updating APIM GraphQL resolvers via a new az apim graphql resolver update command, along with scenario test coverage and help/recording updates.
Changes:
- Register
apim graphql resolver updateas a generic update command and implement the custom update mutator. - Add CLI arguments and help text for the new update command.
- Extend the APIM core scenario test + recordings to cover updating a GraphQL resolver.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/apim/custom.py | Adds the custom update function used by the generic update flow to mutate resolver fields. |
| src/azure-cli/azure/cli/command_modules/apim/commands.py | Registers the new apim graphql resolver update command. |
| src/azure-cli/azure/cli/command_modules/apim/_params.py | Adds argument definitions for the update command. |
| src/azure-cli/azure/cli/command_modules/apim/_help.py | Documents the new update command with an example. |
| src/azure-cli/azure/cli/command_modules/apim/tests/latest/test_apim_scenario.py | Adds a scenario step that runs the new update command. |
| src/azure-cli/azure/cli/command_modules/apim/tests/latest/recordings/test_apim_core_service.yaml | Updates recordings with the GET/PUT interactions for the update command. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| c.argument('resolver_id', | ||
| help='Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance.') | ||
| c.argument('display_name', help='Resolver Name.') | ||
| c.argument('path', help='Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance.') | ||
| c.argument('description', | ||
| help='Description of the resolver. May include HTML formatting tags.') |
| self.cmd( | ||
| 'apim graphql resolver update -g "{rg}" --service-name "{service_name}" --api-id "{graphql_api_id}" --resolver-id "{resolver_id}" --display-name "{resolver_updated_display_name}" --description "{resolver_updated_description}"', | ||
| checks=[self.check('name', '{resolver_id}'), | ||
| self.check('path', '{resolver_path}'), | ||
| self.check('description', '{resolver_updated_description}')]) |
| resolver_count = len(self.cmd('apim graphql resolver list -g "{rg}" -n "{service_name}" --api-id "{graphql_api_id}"').get_output_in_json()) | ||
| self.assertEqual(resolver_count, 1) | ||
|
|
||
| #update resolver |
|
@microsoft-github-policy-service agree |
|
APIM |
|
/azp run |
|
Please note that the code completion time for the upcoming release train is on 06/30/2026 at 02:00 UTC. If you want it to be released in this sprint, please get it ready asap and ping me in Teams directly. |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
@yanzhudd Thanks for triggering the pipelines and the milestone info! I don't have access to the internal Teams, but I'll keep the PR ready and respond quickly to any review feedback. Happy for it to land in the July/August milestone. |
Related command
az apim graphql resolver updateDescription
Adds the missing
updatecommand to theaz apim graphql resolvergroup.The
GraphQLApiResolver.updateoperation exists inazure-mgmt-apimanagementbut was not exposed in the CLI, so the resolver group only supported
create/show/list/delete. This PR completes the CRUD surface, letting users
update a resolver's display name, path, and description in place.
Testing Guide
azdev test apim(playback) passes. Thetest_apim_core_servicescenario nowalso exercises the new command:
az apim graphql resolver update -g <rg> --service-name <svc> --api-id <api> --resolver-id <id> --display-name "..." --description "..."Note: the recording for the new step was added to the existing
test_apim_core_servicecassette. A live recording on Developer SKU was blockedby transient
ManagementApiRequestFailedplatform-upgrade downtime; happy toregenerate a full live recording if preferred.
History Notes
[APIM]
az apim graphql resolver update: Add command to update a GraphQL API resolverThis checklist is used to make sure that common guidelines for a pull request are followed.