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(api-mailer): change transport settings input name #2855

Merged
merged 2 commits into from Dec 14, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions packages/api-mailer/src/graphql/settings.ts
Expand Up @@ -20,16 +20,16 @@ export const createSettingsGraphQL = () => {
replyTo: String
}

type MailerSettingsResponse {
type MailerTransportSettingsResponse {
data: MailerTransportSettings
error: MailerTransportSettingsError
}

type MailerQuery {
getSettings: MailerSettingsResponse!
getSettings: MailerTransportSettingsResponse!
}

input TransportSettingsInput {
input MailerTransportSettingsInput {
host: String!
port: Number
user: String!
Expand All @@ -39,7 +39,7 @@ export const createSettingsGraphQL = () => {
}

type MailerMutation {
saveSettings(data: TransportSettingsInput!): MailerSettingsResponse!
saveSettings(data: MailerTransportSettingsInput!): MailerTransportSettingsResponse!
}

extend type Query {
Expand All @@ -58,9 +58,9 @@ export const createSettingsGraphQL = () => {
try {
const settings = await context.mailer.getSettings();
/**
* We want to remove the password from the response
* We want to remove the password from the response, if it exists.
*/
if (settings) {
if (settings?.password) {
// @ts-ignore
delete settings.password;
}
Expand All @@ -80,9 +80,9 @@ export const createSettingsGraphQL = () => {
input: args.data
});
/**
* We want to remove the password from the response
* We want to remove the password from the response, if it exists.
*/
if (settings) {
if (settings?.password) {
// @ts-ignore
delete settings.password;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/app-mailer/src/views/settings/graphql.ts
Expand Up @@ -53,7 +53,7 @@ export interface SaveSettingsMutationResponse {
};
}
export const SAVE_SETTINGS_MUTATION = gql`
mutation SaveTransportSettings($data: TransportSettingsInput!) {
mutation SaveTransportSettings($data: MailerTransportSettingsInput!) {
mailer {
settings: saveSettings(data: $data) {
data ${SETTINGS_FIELDS}
Expand Down