Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/cli/project_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func createProject(ctx context.Context, ownerId, title string, verbose bool) (ma
url
}
}
}`, ownerId, escapeGraphQLString(title))
}`, escapeGraphQLString(ownerId), escapeGraphQLString(title))
Comment thread
pelikhan marked this conversation as resolved.
Outdated

output, err := workflow.RunGH("Creating project...", "api", "graphql", "-f", "query="+mutation)
if err != nil {
Expand Down Expand Up @@ -370,7 +370,7 @@ func linkProjectToRepo(ctx context.Context, projectId, repoSlug string, verbose
id
}
}
}`, projectId, repoId)
}`, escapeGraphQLString(projectId), escapeGraphQLString(repoId))

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.

Done in the latest commit. Both createProject and linkProjectToRepo (including its repo-ID query) now use static GraphQL query strings with variables passed as separate -f flags to gh api graphql. This eliminates all string interpolation from the query bodies, removing the need for manual escaping in these mutations entirely.


_, err = workflow.RunGH("Linking project to repository...", "api", "graphql", "-f", "query="+mutation)
if err != nil {
Expand Down
Loading