Repository: cli/cli
File: api/queries_pr.go (Go)

Code before:

// SuggestedAssignableActors fetches up to 10 suggested actors for a specific assignable
// (Issue or PullRequest) node ID. `assignableID` is the GraphQL node ID for the Issue/PR.
// If query is empty, the query variable is passed as null to omit filtering.
func SuggestedAssignableActors(client *Client, repo ghrepo.Interface, assignableID string, query string) ([]AssignableActor, error) {
	type responseData struct {
		Viewer struct {
			ID    string
			Login string
			Name  string
		} `graphql:"viewer"`
		Node struct {
			Issue struct {
				SuggestedActors struct {
					Nodes []struct {
						User struct {
							ID       string
							Login    string
							Name     string
							TypeName string `graphql:"__typename"`
						} `graphql:"... on User"`
						Bot struct {
							ID       string
							Login    string
							TypeName string `graphql:"__typename"`
						} `graphql:"... on Bot"`
					}
				} `graphql:"suggestedActors(first: 10, query: $query)"`
			} `graphql:"... on Issue"`
			PullRequest struct {
				SuggestedActors struct {
					Nodes []struct {
						User struct {
							ID       string
							Login    string
							Name     string
							TypeName string `graphql:"__typename"`
						} `graphql:"... on User"`
						Bot struct {
							ID       string
							Login    string
							TypeName string `graphql:"__typename"`
						} `graphql:"... on Bot"`
					}
				} `graphql:"suggestedActors(first: 10, query: $query)"`
			} `graphql:"... on PullRequest"`
		} `graphql:"node(id: $id)"`
	}

	variables := map[string]interface{}{
		"id": githubv4.ID(assignableID),

Review comment (suggestion):
I think we can pull up the `TypeName` field to avoid repeating it:


```suggestion
					Nodes []struct {
					    TypeName string `graphql:"__typename"`
						User struct {
							ID       string
							Login    string
							Name     string
						} `graphql:"... on User"`
						Bot struct {
							ID       string
							Login    string
						} `graphql:"... on Bot"`
					}
```

Code after:

// SuggestedAssignableActors fetches up to 10 suggested actors for a specific assignable
// (Issue or PullRequest) node ID. `assignableID` is the GraphQL node ID for the Issue/PR.
// If query is empty, the query variable is passed as null to omit filtering.
func SuggestedAssignableActors(client *Client, repo ghrepo.Interface, assignableID string, query string) ([]AssignableActor, error) {
	type responseData struct {
		Viewer struct {
			ID    string
			Login string
			Name  string
		} `graphql:"viewer"`
		Node struct {
			Issue struct {
				SuggestedActors struct {
					Nodes []struct {
					    TypeName string `graphql:"__typename"`
						User struct {
							ID       string
							Login    string
							Name     string
						} `graphql:"... on User"`
						Bot struct {
							ID       string
							Login    string
						} `graphql:"... on Bot"`
					}
				} `graphql:"suggestedActors(first: 10, query: $query)"`
			} `graphql:"... on Issue"`
			PullRequest struct {
				SuggestedActors struct {
					Nodes []struct {
					    TypeName string `graphql:"__typename"`
						User struct {
							ID       string
							Login    string
							Name     string							
						} `graphql:"... on User"`
						Bot struct {
							ID       string
							Login    string
						} `graphql:"... on Bot"`
					}
				} `graphql:"suggestedActors(first: 10, query: $query)"`
			} `graphql:"... on PullRequest"`
		} `graphql:"node(id: $id)"`
	}

	variables := map[string]interface{}{
		"id": githubv4.ID(assignableID),
	}
	if query != "" {