Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL: serviceID should be optional #2640

Merged

Conversation

theautoroboto
Copy link
Contributor

Description:
When creating a new service with a heartbeat monitor, CreateHeartbeatMonitorInput is requiring a serviceID that has not yet been created.

Which issue(s) this PR fixes:
This change will make serviceID optional in the schema for CreateHeartbeatMonitorInput, allowing createService to create the heartbeat monitor when the service is created.

Copy link
Member

@mastercactapus mastercactapus left a comment

Choose a reason for hiding this comment

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

A couple more changes will need to go with this; if you run make check locally, it should regenerate the necessary files and give you the error for what's missing.

Namely:

  • in graphql2/graphqlapp/service.go, we just need to take the address of result.ID
  • in graphql2/graphqlapp/heartbeatmonitor.go we need to account for it now being a pointer -- you can use the CreateIntegrationKey method in graphql2/graphqlapp/integrationkey.go for an example.

The underlying store methods will handle validation (e.g., checking for empty ServiceID), so it's enough to just handle the change from string to *string in the GraphQL code.

@theautoroboto theautoroboto changed the title GraphQL: serviceID should be optional Draft: GraphQL: serviceID should be optional Sep 29, 2022
@theautoroboto theautoroboto changed the title Draft: GraphQL: serviceID should be optional GraphQL: serviceID should be optional Sep 29, 2022
@mastercactapus mastercactapus merged commit 47d1125 into target:master Sep 30, 2022
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