chore: remove redundant update connection mutation
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
// Converted mutations
|
||||
import verifyConnection from './mutations/verify-connection.js';
|
||||
import resetConnection from './mutations/reset-connection.js';
|
||||
import updateConnection from './mutations/update-connection.js';
|
||||
|
||||
const mutationResolvers = {
|
||||
resetConnection,
|
||||
<<<<<<< HEAD
|
||||
updateConnection,
|
||||
=======
|
||||
updateCurrentUser,
|
||||
>>>>>>> 82cde73e (chore: remove redundant update connection mutation)
|
||||
verifyConnection,
|
||||
};
|
||||
|
||||
|
@@ -1,33 +0,0 @@
|
||||
import AppAuthClient from '../../models/app-auth-client.js';
|
||||
|
||||
const updateConnection = async (_parent, params, context) => {
|
||||
context.currentUser.can('create', 'Connection');
|
||||
|
||||
let connection = await context.currentUser
|
||||
.$relatedQuery('connections')
|
||||
.findOne({
|
||||
id: params.input.id,
|
||||
})
|
||||
.throwIfNotFound();
|
||||
|
||||
let formattedData = params.input.formattedData;
|
||||
|
||||
if (params.input.appAuthClientId) {
|
||||
const appAuthClient = await AppAuthClient.query()
|
||||
.findById(params.input.appAuthClientId)
|
||||
.throwIfNotFound();
|
||||
|
||||
formattedData = appAuthClient.formattedAuthDefaults;
|
||||
}
|
||||
|
||||
connection = await connection.$query().patchAndFetch({
|
||||
formattedData: {
|
||||
...connection.formattedData,
|
||||
...formattedData,
|
||||
},
|
||||
});
|
||||
|
||||
return connection;
|
||||
};
|
||||
|
||||
export default updateConnection;
|
@@ -4,7 +4,6 @@ type Query {
|
||||
|
||||
type Mutation {
|
||||
resetConnection(input: ResetConnectionInput): Connection
|
||||
updateConnection(input: UpdateConnectionInput): Connection
|
||||
verifyConnection(input: VerifyConnectionInput): Connection
|
||||
}
|
||||
|
||||
@@ -186,12 +185,6 @@ type SamlAuthProvidersRoleMapping {
|
||||
remoteRoleName: String
|
||||
}
|
||||
|
||||
input UpdateConnectionInput {
|
||||
id: String!
|
||||
formattedData: JSONObject
|
||||
appAuthClientId: String
|
||||
}
|
||||
|
||||
input ResetConnectionInput {
|
||||
id: String!
|
||||
}
|
||||
|
@@ -1,9 +1,7 @@
|
||||
import { UPDATE_CONNECTION } from './update-connection';
|
||||
import { VERIFY_CONNECTION } from './verify-connection';
|
||||
import { RESET_CONNECTION } from './reset-connection';
|
||||
|
||||
const mutations = {
|
||||
updateConnection: UPDATE_CONNECTION,
|
||||
verifyConnection: VERIFY_CONNECTION,
|
||||
resetConnection: RESET_CONNECTION,
|
||||
};
|
||||
|
@@ -1,13 +0,0 @@
|
||||
import { gql } from '@apollo/client';
|
||||
export const UPDATE_CONNECTION = gql`
|
||||
mutation UpdateConnection($input: UpdateConnectionInput) {
|
||||
updateConnection(input: $input) {
|
||||
id
|
||||
key
|
||||
verified
|
||||
formattedData {
|
||||
screenName
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
Reference in New Issue
Block a user