-
Notifications
You must be signed in to change notification settings - Fork 13
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
Fixes for terraform component types #515
Conversation
@@ -14,6 +16,40 @@ type ComponentTypeConnection struct { | |||
TotalCount int `json:"totalCount" graphql:"-"` | |||
} | |||
|
|||
func (s *ComponentType) GetProperties(client *Client, v *PayloadVariables) (*PropertyDefinitionConnection, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the pattern we use for connection types because it limits how much data we pull back when doing "list" api calls.
IsDefault bool // Whether or not the component type is the default (Required) | ||
Name string // The name of the component type (Required) | ||
Timestamps Timestamps // When the component type was created and updated (Required) | ||
Properties *PropertyDefinitionConnection `graphql:"-"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will get to get ported into codegen but this effectively tells the graphql client to ingore this field since we'll populate it with GetProperties
when called
@@ -13,7 +13,7 @@ type PropertyDefinition struct { | |||
DisplayType PropertyDefinitionDisplayTypeEnum `graphql:"displayType" json:"displayType"` | |||
PropertyDisplayStatus PropertyDisplayStatusEnum `graphql:"propertyDisplayStatus" json:"propertyDisplayStatus"` | |||
LockedStatus PropertyLockedStatusEnum `graphql:"lockedStatus" json:"lockedStatus"` | |||
Schema JSON `json:"schema" scalar:"true"` | |||
Schema JSONSchema `json:"schema" scalar:"true"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why it was coded like this but in our API its actually this type (this struct isn't under codegen yet)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Tested it locally 👍
Resolves #
Problem
Connection types were not setup by codegen so this was missed
Solution
Add connection type for property def's on component types
Checklist