Skip to content

Commit

Permalink
add get method in cloud profile service client (#7)
Browse files Browse the repository at this point in the history
* add get method in service/cloud-profile client

* add cloudProfileId scalar in ProjectFragment graphql

* regenerate api client methods
  • Loading branch information
98sean98 authored Aug 1, 2023
1 parent 0fb377c commit 7ed5601
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 4 deletions.
52 changes: 49 additions & 3 deletions api/generated/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 18 additions & 1 deletion api/generated/models_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions service/cloud_profile/get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cloud_profile

import (
"context"
"github.com/deploifai/sdk-go/api/generated"
)

// Get returns a cloud profile.
func (c *Client) Get(ctx context.Context, where generated.CloudProfileWhereUniqueInput) (cp generated.CloudProfileFragment, err error) {

data, err := c.options.API.GetGQLClient().GetCloudProfile(ctx, where)
if err != nil {
return cp, c.options.API.ProcessGQLError(err)
}

return *data.GetCloudProfile(), nil

}
6 changes: 6 additions & 0 deletions service/cloud_profile/query.gql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ fragment CloudProfileFragment on CloudProfile {
provider
}

query GetCloudProfile($where: CloudProfileWhereUniqueInput!) {
cloudProfile(where: $where) {
...CloudProfileFragment
}
}

query GetCloudProfiles($whereAccount: AccountWhereUniqueInput! $whereCloudProfile: CloudProfileWhereInput) {
cloudProfiles(
whereAccount: $whereAccount
Expand Down
1 change: 1 addition & 0 deletions service/project/query.gql
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ fragment ProjectFragment on Project {
id
name
createdAt
cloudProfileId
}


Expand Down

0 comments on commit 7ed5601

Please sign in to comment.