@@ -99,6 +99,16 @@ type OrbPublishResponse struct {
99
99
}
100
100
}
101
101
102
+ // The OrbImportVersionResponse type matches the data shape of the GQL response for
103
+ // importing an orb version.
104
+ type OrbImportVersionResponse struct {
105
+ ImportOrbVersion struct {
106
+ Orb Orb
107
+
108
+ Errors GQLErrorsCollection
109
+ }
110
+ }
111
+
102
112
// The OrbPromoteResponse type matches the data shape of the GQL response for
103
113
// promoting an orb.
104
114
type OrbPromoteResponse struct {
@@ -579,7 +589,7 @@ func OrbQuery(cl *graphql.Client, configPath string) (*ConfigResponse, error) {
579
589
580
590
// OrbImportVersion publishes a new version of an orb using the provided source and id.
581
591
func OrbImportVersion (cl * graphql.Client , orbSrc string , orbID string , orbVersion string ) (* Orb , error ) {
582
- var response OrbPublishResponse
592
+ var response OrbImportVersionResponse
583
593
584
594
query := `
585
595
mutation($config: String!, $orbId: UUID!, $version: String!) {
@@ -608,11 +618,11 @@ func OrbImportVersion(cl *graphql.Client, orbSrc string, orbID string, orbVersio
608
618
return nil , errors .Wrap (err , "unable to import orb version" )
609
619
}
610
620
611
- if len (response .PublishOrb .Errors ) > 0 {
612
- return nil , response .PublishOrb .Errors
621
+ if len (response .ImportOrbVersion .Errors ) > 0 {
622
+ return nil , response .ImportOrbVersion .Errors
613
623
}
614
624
615
- return & response .PublishOrb .Orb , nil
625
+ return & response .ImportOrbVersion .Orb , nil
616
626
}
617
627
618
628
// OrbPublishByID publishes a new version of an orb by id
0 commit comments