mirror of
https://github.com/wassname/talk.git
synced 2026-07-31 12:50:48 +08:00
review: adapted graph responses for OIDC mutations
This commit is contained in:
@@ -21,9 +21,7 @@ export default ({ mongo, redis, tenantCache, tenant }: TenantContext) => ({
|
||||
update(mongo, redis, tenantCache, tenant, omitBy(input, isNull)),
|
||||
regenerateSSOKey: (): Promise<Tenant | null> =>
|
||||
regenerateSSOKey(mongo, redis, tenantCache, tenant),
|
||||
createOIDCAuthIntegration: (
|
||||
input: GQLCreateOIDCAuthIntegrationInput
|
||||
): Promise<Tenant | null> =>
|
||||
createOIDCAuthIntegration: (input: GQLCreateOIDCAuthIntegrationInput) =>
|
||||
createOIDCAuthIntegration(
|
||||
mongo,
|
||||
redis,
|
||||
@@ -31,9 +29,7 @@ export default ({ mongo, redis, tenantCache, tenant }: TenantContext) => ({
|
||||
tenant,
|
||||
input.configuration
|
||||
),
|
||||
updateOIDCAuthIntegration: (
|
||||
input: GQLUpdateOIDCAuthIntegrationInput
|
||||
): Promise<Tenant | null> =>
|
||||
updateOIDCAuthIntegration: (input: GQLUpdateOIDCAuthIntegrationInput) =>
|
||||
updateOIDCAuthIntegration(
|
||||
mongo,
|
||||
redis,
|
||||
@@ -42,8 +38,6 @@ export default ({ mongo, redis, tenantCache, tenant }: TenantContext) => ({
|
||||
input.id,
|
||||
input.configuration
|
||||
),
|
||||
deleteOIDCAuthIntegration: (
|
||||
input: GQLDeleteOIDCAuthIntegrationInput
|
||||
): Promise<Tenant | null> =>
|
||||
deleteOIDCAuthIntegration: (input: GQLDeleteOIDCAuthIntegrationInput) =>
|
||||
deleteOIDCAuthIntegration(mongo, redis, tenantCache, tenant, input.id),
|
||||
});
|
||||
|
||||
@@ -51,18 +51,42 @@ const Mutation: GQLMutationTypeResolver<void> = {
|
||||
settings: await ctx.mutators.Settings.regenerateSSOKey(),
|
||||
clientMutationId: input.clientMutationId,
|
||||
}),
|
||||
createOIDCAuthIntegration: async (source, { input }, ctx) => ({
|
||||
settings: await ctx.mutators.Settings.createOIDCAuthIntegration(input),
|
||||
clientMutationId: input.clientMutationId,
|
||||
}),
|
||||
updateOIDCAuthIntegration: async (source, { input }, ctx) => ({
|
||||
settings: await ctx.mutators.Settings.updateOIDCAuthIntegration(input),
|
||||
clientMutationId: input.clientMutationId,
|
||||
}),
|
||||
deleteOIDCAuthIntegration: async (source, { input }, ctx) => ({
|
||||
settings: await ctx.mutators.Settings.deleteOIDCAuthIntegration(input),
|
||||
clientMutationId: input.clientMutationId,
|
||||
}),
|
||||
createOIDCAuthIntegration: async (source, { input }, ctx) => {
|
||||
const result = await ctx.mutators.Settings.createOIDCAuthIntegration(input);
|
||||
if (!result) {
|
||||
return { clientMutationId: input.clientMutationId };
|
||||
}
|
||||
|
||||
return {
|
||||
integration: result.integration,
|
||||
settings: result.tenant,
|
||||
clientMutationId: input.clientMutationId,
|
||||
};
|
||||
},
|
||||
updateOIDCAuthIntegration: async (source, { input }, ctx) => {
|
||||
const result = await ctx.mutators.Settings.updateOIDCAuthIntegration(input);
|
||||
if (!result) {
|
||||
return { clientMutationId: input.clientMutationId };
|
||||
}
|
||||
|
||||
return {
|
||||
integration: result.integration,
|
||||
settings: result.tenant,
|
||||
clientMutationId: input.clientMutationId,
|
||||
};
|
||||
},
|
||||
deleteOIDCAuthIntegration: async (source, { input }, ctx) => {
|
||||
const result = await ctx.mutators.Settings.deleteOIDCAuthIntegration(input);
|
||||
if (!result) {
|
||||
return { clientMutationId: input.clientMutationId };
|
||||
}
|
||||
|
||||
return {
|
||||
integration: result.integration,
|
||||
settings: result.tenant,
|
||||
clientMutationId: input.clientMutationId,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
export default Mutation;
|
||||
|
||||
@@ -2046,6 +2046,11 @@ input CreateOIDCAuthIntegrationInput {
|
||||
}
|
||||
|
||||
type CreateOIDCAuthIntegrationPayload {
|
||||
"""
|
||||
integration is the OIDCAuthIntegration we just created.
|
||||
"""
|
||||
integration: OIDCAuthIntegration
|
||||
|
||||
"""
|
||||
settings is the Settings that the OIDCAuthIntegration was created on.
|
||||
"""
|
||||
@@ -2143,6 +2148,11 @@ input UpdateOIDCAuthIntegrationInput {
|
||||
}
|
||||
|
||||
type UpdateOIDCAuthIntegrationPayload {
|
||||
"""
|
||||
integration is the OIDCAuthIntegration we just updated.
|
||||
"""
|
||||
integration: OIDCAuthIntegration
|
||||
|
||||
"""
|
||||
settings is the Settings that the OIDCAuthIntegration was updated on.
|
||||
"""
|
||||
@@ -2172,7 +2182,13 @@ input DeleteOIDCAuthIntegrationInput {
|
||||
|
||||
type DeleteOIDCAuthIntegrationPayload {
|
||||
"""
|
||||
settings is the Settings that the OIDCAuthIntegration was deleted on.
|
||||
integration is the OIDCAuthIntegration we just deleted.
|
||||
"""
|
||||
integration: OIDCAuthIntegration
|
||||
|
||||
"""
|
||||
settings is the Settings that the OIDCAuthIntegration was deleted on with the
|
||||
OIDCAuthIntegration removed from it.
|
||||
"""
|
||||
settings: Settings
|
||||
|
||||
|
||||
Reference in New Issue
Block a user