Skip to content

Fix GraphQL call using the wrong case for method derivation#2660

Merged
SamMorrowDrums merged 1 commit into
mainfrom
fix-project-iteration-field-creation
Jun 10, 2026
Merged

Fix GraphQL call using the wrong case for method derivation#2660
SamMorrowDrums merged 1 commit into
mainfrom
fix-project-iteration-field-creation

Conversation

@moritzheiber

Copy link
Copy Markdown
Contributor

Summary

Fixes create_iteration_field, which failed at runtime because the GraphQL mutation selected projectV2field (lowercase) instead of the schema's projectV2Field.

Why

The inner ProjectV2Field struct fields in createIterationField had no graphql: tag, so shurcooL/githubv4 auto-derived the selection name and mis-cased the word boundary after the embedded V2, producing projectV2field. GitHub's API rejected this, blocking iteration field creation entirely.

Fixes #

What changed

  • Added explicit `graphql:"projectV2Field"` tags to the createProjectV2Field and updateProjectV2Field mutation structs in projects.go.
  • Made the test matchers in projects_v2_test.go schema-faithful (tagged projectV2Field) so they reproduce the bug and guard against the casing regression.

MCP impact

  • No tool or API changes — tool schema is unchanged; this is a runtime GraphQL fix only.

Prompts tested (tool changes only)

  • N/A (no tool schema changes)

Security / limits

  • No security or limits impact

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with lint
  • Tested locally with test

Docs

  • Not needed
@moritzheiber moritzheiber requested a review from a team as a code owner June 10, 2026 10:39
Copilot AI review requested due to automatic review settings June 10, 2026 10:39

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.

Pull request overview

Fixes a runtime GraphQL mutation failure in create_iteration_field caused by shurcooL/githubv4 auto-deriving the wrong selection name casing (projectV2field vs projectV2Field) when no explicit graphql: tag is present on the nested ProjectV2Field selection.

Changes:

  • Added explicit graphql:"projectV2Field" tags to the nested ProjectV2Field selections in the createProjectV2Field and updateProjectV2Field mutations.
  • Updated GraphQL mock matchers in projects_v2_test.go to require the schema-faithful projectV2Field selection, preventing regressions.
Show a summary per file
File Description
pkg/github/projects.go Adds explicit GraphQL selection tags to ensure correct field casing in mutations used by create_iteration_field.
pkg/github/projects_v2_test.go Updates mutation matchers to assert the correct projectV2Field selection name and guard against casing regressions.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants