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

feat: multi tenancy crud adjustments #535

Merged
merged 7 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 18 additions & 25 deletions packages/webapp-libs/webapp-api-client/graphql/schema/api.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,8 @@ type Query {
currentUser: CurrentUserType
hasUnreadNotifications: Boolean
allNotifications(before: String, after: String, first: Int, last: Int): NotificationConnection
crudDemoItem(
"The ID of the object"
id: ID!
): CrudDemoItemType
allCrudDemoItems(before: String, after: String, first: Int, last: Int): CrudDemoItemConnection
crudDemoItem(id: ID, tenantId: ID): CrudDemoItemType
allCrudDemoItems(tenantId: ID, before: String, after: String, first: Int, last: Int): CrudDemoItemConnection
allContentfulDemoItemFavorites(before: String, after: String, first: Int, last: Int): ContentfulDemoItemFavoriteConnection
allDocumentDemoItems(before: String, after: String, first: Int, last: Int): DocumentDemoItemConnection
node(
Expand Down Expand Up @@ -94,7 +91,7 @@ type TenantType implements Node {
}
type TenantMembershipType implements Node {
id: ID!
role: MultitenancyTenantMembershipRoleChoices!
role: TenantUserRole
inviteeEmailAddress: String
invitationAccepted: Boolean
userId: ID
Expand Down Expand Up @@ -662,6 +659,7 @@ type UserType {
avatar: String
}
type CrudDemoItemType implements Node {
tenant: TenantType
"The ID of the object"
id: ID!
name: String!
Expand Down Expand Up @@ -1020,12 +1018,9 @@ interface Node {
"The ID of the object"
id: ID!
}
enum MultitenancyTenantMembershipRoleChoices {
"Owner"
enum TenantUserRole {
OWNER
"Administrator"
ADMIN
"Member"
MEMBER
}
enum DjstripeProductTypeChoices {
Expand Down Expand Up @@ -1414,11 +1409,6 @@ enum DjstripeChargeStatusChoices {
"Succeeded"
SUCCEEDED
}
enum TenantUserRole {
OWNER
ADMIN
MEMBER
}
enum DjstripeSetupIntentCancellationReasonChoices {
"Abandoned"
ABANDONED
Expand Down Expand Up @@ -1465,7 +1455,7 @@ input CreateTenantInvitationMutationInput {
}
input UpdateTenantMembershipMutationInput {
id: ID!
tenantId: String
tenantId: String!
role: TenantUserRole!
clientMutationId: String
}
Expand All @@ -1488,7 +1478,7 @@ input DeclineTenantInvitationMutationInput {
}
input DeleteTenantMembershipMutationInput {
id: String
tenantId: String
tenantId: String!
clientMutationId: String
}
input GenerateSaasIdeasMutationInput {
Expand All @@ -1497,38 +1487,38 @@ input GenerateSaasIdeasMutationInput {
}
input ChangeActiveSubscriptionMutationInput {
id: String
tenantId: String
tenantId: String!
price: String!
clientMutationId: String
}
input CancelActiveSubscriptionMutationInput {
id: String
tenantId: String
tenantId: String!
clientMutationId: String
}
input UpdateDefaultPaymentMethodMutationInput {
id: String
tenantId: String
tenantId: String!
clientMutationId: String
}
input DeletePaymentMethodMutationInput {
id: String
tenantId: String
tenantId: String!
clientMutationId: String
}
input CreatePaymentIntentMutationInput {
tenantId: String
tenantId: String!
product: String!
clientMutationId: String
}
input UpdatePaymentIntentMutationInput {
id: ID!
tenantId: String
tenantId: String!
product: String!
clientMutationId: String
}
input CreateSetupIntentMutationInput {
tenantId: String
tenantId: String!
clientMutationId: String
}
input ChangePasswordMutationInput {
Expand Down Expand Up @@ -1597,18 +1587,21 @@ input MarkReadAllNotificationsMutationInput {
clientMutationId: String
}
input CreateCrudDemoItemMutationInput {
tenantId: String!
name: String!
createdBy: String
clientMutationId: String
}
input UpdateCrudDemoItemMutationInput {
id: ID!
tenantId: String!
name: String!
createdBy: String
id: ID!
clientMutationId: String
}
input DeleteCrudDemoItemMutationInput {
id: String
tenantId: String!
clientMutationId: String
}
input CreateDocumentDemoItemMutationInput {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ const documents = {
"\n fragment demoItemListItemFragment on DemoItem {\n title\n image {\n title\n url\n }\n }\n": types.DemoItemListItemFragmentFragmentDoc,
"\n query demoItemsAllQuery {\n demoItemCollection {\n items {\n sys {\n id\n }\n ...demoItemListItemFragment\n }\n }\n }\n": types.DemoItemsAllQueryDocument,
"\n mutation addCrudDemoItemMutation($input: CreateCrudDemoItemMutationInput!) {\n createCrudDemoItem(input: $input) {\n crudDemoItemEdge {\n node {\n id\n name\n }\n }\n }\n }\n": types.AddCrudDemoItemMutationDocument,
"\n query crudDemoItemDetailsQuery($id: ID!) {\n crudDemoItem(id: $id) {\n id\n name\n }\n }\n": types.CrudDemoItemDetailsQueryDocument,
"\n query crudDemoItemListQuery($first: Int, $after: String, $last: Int, $before: String) {\n allCrudDemoItems(first: $first, after: $after, last: $last, before: $before) {\n edges {\n node {\n id\n ...crudDemoItemListItem\n }\n }\n pageInfo {\n startCursor\n endCursor\n hasPreviousPage\n hasNextPage\n }\n }\n }\n": types.CrudDemoItemListQueryDocument,
"\n query crudDemoItemDetailsQuery($id: ID!, $tenantId: ID!) {\n crudDemoItem(id: $id, tenantId: $tenantId) {\n id\n name\n }\n }\n": types.CrudDemoItemDetailsQueryDocument,
"\n query crudDemoItemListQuery($tenantId: ID!, $first: Int, $after: String, $last: Int, $before: String) {\n allCrudDemoItems(tenantId: $tenantId, first: $first, after: $after, last: $last, before: $before) {\n edges {\n node {\n id\n ...crudDemoItemListItem\n }\n }\n pageInfo {\n startCursor\n endCursor\n hasPreviousPage\n hasNextPage\n }\n }\n }\n": types.CrudDemoItemListQueryDocument,
"\n query crudDemoItemListItemTestQuery {\n item: crudDemoItem(id: \"test-id\") {\n ...crudDemoItemListItem\n }\n }\n": types.CrudDemoItemListItemTestQueryDocument,
"\n mutation crudDemoItemListItemDeleteMutation($input: DeleteCrudDemoItemMutationInput!) {\n deleteCrudDemoItem(input: $input) {\n deletedIds\n }\n }\n": types.CrudDemoItemListItemDeleteMutationDocument,
"\n fragment crudDemoItemListItem on CrudDemoItemType {\n id\n name\n }\n": types.CrudDemoItemListItemFragmentDoc,
"\n query crudDemoItemListItemDefaultStoryQuery {\n item: crudDemoItem(id: \"test-id\") {\n ...crudDemoItemListItem\n }\n }\n": types.CrudDemoItemListItemDefaultStoryQueryDocument,
"\n query editCrudDemoItemQuery($id: ID!) {\n crudDemoItem(id: $id) {\n id\n name\n }\n }\n": types.EditCrudDemoItemQueryDocument,
"\n query editCrudDemoItemQuery($id: ID!, $tenantId: ID!) {\n crudDemoItem(id: $id, tenantId: $tenantId) {\n id\n name\n }\n }\n": types.EditCrudDemoItemQueryDocument,
"\n mutation editCrudDemoItemContentMutation($input: UpdateCrudDemoItemMutationInput!) {\n updateCrudDemoItem(input: $input) {\n crudDemoItem {\n id\n name\n }\n }\n }\n": types.EditCrudDemoItemContentMutationDocument,
"\n fragment documentListItem on DocumentDemoItemType {\n id\n file {\n url\n name\n }\n createdAt\n }\n": types.DocumentListItemFragmentDoc,
"\n query documentsListQuery {\n allDocumentDemoItems(first: 10) {\n edges {\n node {\n id\n ...documentListItem\n }\n }\n }\n }\n": types.DocumentsListQueryDocument,
Expand Down Expand Up @@ -156,11 +156,11 @@ export function gql(source: "\n mutation addCrudDemoItemMutation($input: Create
/**
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function gql(source: "\n query crudDemoItemDetailsQuery($id: ID!) {\n crudDemoItem(id: $id) {\n id\n name\n }\n }\n"): (typeof documents)["\n query crudDemoItemDetailsQuery($id: ID!) {\n crudDemoItem(id: $id) {\n id\n name\n }\n }\n"];
export function gql(source: "\n query crudDemoItemDetailsQuery($id: ID!, $tenantId: ID!) {\n crudDemoItem(id: $id, tenantId: $tenantId) {\n id\n name\n }\n }\n"): (typeof documents)["\n query crudDemoItemDetailsQuery($id: ID!, $tenantId: ID!) {\n crudDemoItem(id: $id, tenantId: $tenantId) {\n id\n name\n }\n }\n"];
/**
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function gql(source: "\n query crudDemoItemListQuery($first: Int, $after: String, $last: Int, $before: String) {\n allCrudDemoItems(first: $first, after: $after, last: $last, before: $before) {\n edges {\n node {\n id\n ...crudDemoItemListItem\n }\n }\n pageInfo {\n startCursor\n endCursor\n hasPreviousPage\n hasNextPage\n }\n }\n }\n"): (typeof documents)["\n query crudDemoItemListQuery($first: Int, $after: String, $last: Int, $before: String) {\n allCrudDemoItems(first: $first, after: $after, last: $last, before: $before) {\n edges {\n node {\n id\n ...crudDemoItemListItem\n }\n }\n pageInfo {\n startCursor\n endCursor\n hasPreviousPage\n hasNextPage\n }\n }\n }\n"];
export function gql(source: "\n query crudDemoItemListQuery($tenantId: ID!, $first: Int, $after: String, $last: Int, $before: String) {\n allCrudDemoItems(tenantId: $tenantId, first: $first, after: $after, last: $last, before: $before) {\n edges {\n node {\n id\n ...crudDemoItemListItem\n }\n }\n pageInfo {\n startCursor\n endCursor\n hasPreviousPage\n hasNextPage\n }\n }\n }\n"): (typeof documents)["\n query crudDemoItemListQuery($tenantId: ID!, $first: Int, $after: String, $last: Int, $before: String) {\n allCrudDemoItems(tenantId: $tenantId, first: $first, after: $after, last: $last, before: $before) {\n edges {\n node {\n id\n ...crudDemoItemListItem\n }\n }\n pageInfo {\n startCursor\n endCursor\n hasPreviousPage\n hasNextPage\n }\n }\n }\n"];
/**
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
Expand All @@ -180,7 +180,7 @@ export function gql(source: "\n query crudDemoItemListItemDefaultStoryQuery {\n
/**
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function gql(source: "\n query editCrudDemoItemQuery($id: ID!) {\n crudDemoItem(id: $id) {\n id\n name\n }\n }\n"): (typeof documents)["\n query editCrudDemoItemQuery($id: ID!) {\n crudDemoItem(id: $id) {\n id\n name\n }\n }\n"];
export function gql(source: "\n query editCrudDemoItemQuery($id: ID!, $tenantId: ID!) {\n crudDemoItem(id: $id, tenantId: $tenantId) {\n id\n name\n }\n }\n"): (typeof documents)["\n query editCrudDemoItemQuery($id: ID!, $tenantId: ID!) {\n crudDemoItem(id: $id, tenantId: $tenantId) {\n id\n name\n }\n }\n"];
/**
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
Expand Down
Loading
Loading