Skip to content

Commit aa05822

Browse files
author
nazarfil
committed
updated the webapp client
1 parent c385c00 commit aa05822

5 files changed

Lines changed: 23 additions & 26 deletions

File tree

openhexa/graphql/graphql_client/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@
228228
from .get_users import GetUsers, GetUsersUsers, GetUsersUsersAvatar
229229
from .get_webapp_by_slug import (
230230
GetWebappBySlug,
231-
GetWebappBySlugWebappBySlug,
232-
GetWebappBySlugWebappBySlugCreatedBy,
233-
GetWebappBySlugWebappBySlugPermissions,
234-
GetWebappBySlugWebappBySlugWorkspace,
231+
GetWebappBySlugWebapp,
232+
GetWebappBySlugWebappCreatedBy,
233+
GetWebappBySlugWebappPermissions,
234+
GetWebappBySlugWebappWorkspace,
235235
)
236236
from .input_types import (
237237
AddOrganizationMemberInput,
@@ -618,10 +618,10 @@
618618
"GetUsersUsers",
619619
"GetUsersUsersAvatar",
620620
"GetWebappBySlug",
621-
"GetWebappBySlugWebappBySlug",
622-
"GetWebappBySlugWebappBySlugCreatedBy",
623-
"GetWebappBySlugWebappBySlugPermissions",
624-
"GetWebappBySlugWebappBySlugWorkspace",
621+
"GetWebappBySlugWebapp",
622+
"GetWebappBySlugWebappCreatedBy",
623+
"GetWebappBySlugWebappPermissions",
624+
"GetWebappBySlugWebappWorkspace",
625625
"GraphQLClientError",
626626
"GraphQLClientGraphQLError",
627627
"GraphQLClientGraphQLMultiError",

openhexa/graphql/graphql_client/client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
from .get_connection import GetConnection, GetConnectionConnectionBySlug
4545
from .get_file_by_path import GetFileByPath, GetFileByPathGetFileByPath
4646
from .get_users import GetUsers, GetUsersUsers
47-
from .get_webapp_by_slug import GetWebappBySlug, GetWebappBySlugWebappBySlug
47+
from .get_webapp_by_slug import GetWebappBySlug, GetWebappBySlugWebapp
4848
from .input_types import (
4949
AddToFavoritesInput,
5050
ArchiveWorkspaceInput,
@@ -1097,11 +1097,11 @@ def get_file_by_path(
10971097

10981098
def get_webapp_by_slug(
10991099
self, workspace_slug: str, webapp_slug: str, **kwargs: Any
1100-
) -> Optional[GetWebappBySlugWebappBySlug]:
1100+
) -> Optional[GetWebappBySlugWebapp]:
11011101
query = gql(
11021102
"""
11031103
query getWebappBySlug($workspaceSlug: String!, $webappSlug: String!) {
1104-
webappBySlug(workspaceSlug: $workspaceSlug, webappSlug: $webappSlug) {
1104+
webapp(workspaceSlug: $workspaceSlug, slug: $webappSlug) {
11051105
id
11061106
name
11071107
description
@@ -1133,4 +1133,4 @@ def get_webapp_by_slug(
11331133
query=query, operation_name="getWebappBySlug", variables=variables, **kwargs
11341134
)
11351135
data = self.get_data(response)
1136-
return GetWebappBySlug.model_validate(data).webapp_by_slug
1136+
return GetWebappBySlug.model_validate(data).webapp

openhexa/graphql/graphql_client/get_webapp_by_slug.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,36 @@
99

1010

1111
class GetWebappBySlug(BaseModel):
12-
webapp_by_slug: Optional["GetWebappBySlugWebappBySlug"] = Field(
13-
alias="webappBySlug"
14-
)
12+
webapp: Optional["GetWebappBySlugWebapp"]
1513

1614

17-
class GetWebappBySlugWebappBySlug(BaseModel):
15+
class GetWebappBySlugWebapp(BaseModel):
1816
id: Any
1917
name: str
2018
description: Optional[str]
2119
url: str
2220
icon: Optional[str]
2321
is_favorite: bool = Field(alias="isFavorite")
24-
created_by: "GetWebappBySlugWebappBySlugCreatedBy" = Field(alias="createdBy")
25-
workspace: "GetWebappBySlugWebappBySlugWorkspace"
26-
permissions: "GetWebappBySlugWebappBySlugPermissions"
22+
created_by: "GetWebappBySlugWebappCreatedBy" = Field(alias="createdBy")
23+
workspace: "GetWebappBySlugWebappWorkspace"
24+
permissions: "GetWebappBySlugWebappPermissions"
2725

2826

29-
class GetWebappBySlugWebappBySlugCreatedBy(BaseModel):
27+
class GetWebappBySlugWebappCreatedBy(BaseModel):
3028
id: Any
3129
display_name: str = Field(alias="displayName")
3230
email: str
3331

3432

35-
class GetWebappBySlugWebappBySlugWorkspace(BaseModel):
33+
class GetWebappBySlugWebappWorkspace(BaseModel):
3634
slug: str
3735
name: str
3836

3937

40-
class GetWebappBySlugWebappBySlugPermissions(BaseModel):
38+
class GetWebappBySlugWebappPermissions(BaseModel):
4139
update: bool
4240
delete: bool
4341

4442

4543
GetWebappBySlug.model_rebuild()
46-
GetWebappBySlugWebappBySlug.model_rebuild()
44+
GetWebappBySlugWebapp.model_rebuild()

openhexa/graphql/queries.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ query getFileByPath($path: String!, $workspaceSlug: String!) {
489489
}
490490

491491
query getWebappBySlug($workspaceSlug: String!, $webappSlug: String!) {
492-
webappBySlug(workspaceSlug: $workspaceSlug, webappSlug: $webappSlug) {
492+
webapp(workspaceSlug: $workspaceSlug, slug: $webappSlug) {
493493
id
494494
name
495495
description

openhexa/graphql/schema.generated.graphql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3381,8 +3381,7 @@ type Query {
33813381

33823382
"""Search users."""
33833383
users(organizationId: UUID, query: String!, workspaceSlug: String): [User!]!
3384-
webapp(id: UUID!): Webapp
3385-
webappBySlug(webappSlug: String!, workspaceSlug: String!): Webapp
3384+
webapp(workspaceSlug: String!, slug: String!): Webapp
33863385
webapps(favorite: Boolean, page: Int, perPage: Int, workspaceSlug: String): WebappsPage!
33873386
workspace(slug: String!): Workspace
33883387
workspaces(organizationId: UUID, page: Int, perPage: Int, query: String): WorkspacePage!

0 commit comments

Comments
 (0)