Skip to content

Conversation

@derek-etherton-opslevel
Copy link
Contributor

@derek-etherton-opslevel derek-etherton-opslevel commented Jul 3, 2025

Problem

The User struct does not have Contacts.

Solution

Add Contacts to the User struct.

Unit tests should be good, but manually verified w/ this:

func main() {
	apiToken := os.Getenv("OPSLEVEL_API_TOKEN")
	if apiToken == "" {
		log.Fatal("OPSLEVEL_API_TOKEN environment variable is not set")
	}

	client := opslevel.NewGQLClient(opslevel.SetAPIToken(apiToken))

	users, err := client.ListUsers(nil)
	if err != nil {
		log.Fatalf("Failed to list users: %v", err)
	}

	for _, user := range users.Nodes {
		fmt.Printf("User: %s\n", user.Name)
		fmt.Printf("Contacts: %+v\n", user.Contacts)
	}
}

Checklist

  • I have run this code, and it appears to resolve the stated issue.
  • This PR does not reduce total test coverage
  • This PR has no user interface changes or has already received approval from product management to change the interface.
  • Does this change require a Terraform schema change?
    • If so what is the ticket or PR #
  • Make a changie entry that explains the customer facing outcome of this change

@derek-etherton-opslevel derek-etherton-opslevel requested review from jasonopslevel and p25marti and removed request for p25marti July 3, 2025 19:22
Copy link
Contributor

@jasonopslevel jasonopslevel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@derek-etherton-opslevel derek-etherton-opslevel merged commit 1bcffbd into main Jul 3, 2025
6 checks passed
@derek-etherton-opslevel derek-etherton-opslevel deleted the 13608-add-contacts-to-user branch July 3, 2025 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants