cli / go-gh

A Go module for interacting with gh and the GitHub API from the command line.
https://pkg.go.dev/github.com/cli/go-gh/v2
MIT License
322 stars 45 forks source link

Add a GraphQL Mutation with an `input` object to examples #98

Closed mntlty closed 1 year ago

mntlty commented 1 year ago

I noticed that there are no examples of Mutations in https://github.com/cli/go-gh/blob/trunk/example_gh_test.go

I think this is important for a few reasons:

If you agree, I'd be happy to open a PR to update, and would like to know:

  1. is addStar a good reference, or is there another that looks better?
  2. for variables, would it be better to use https://github.com/shurcooL/githubv4 or to use only standard types?
  3. should the Readme also mention mutations, or is it sufficient to have them in the examples?
mislav commented 1 year ago

Great idea! Go ahead please.

  1. addStar seems fine! Any simple mutation would do.
  2. We like to use githubv4 because it validates the input types.
  3. No, the README doesn't need to showcase mutations.