feat(useAuthenticateApp): remove redundant graphql implementation
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
const mutations = {};
|
||||
|
||||
export default mutations;
|
@@ -1,20 +1,3 @@
|
||||
import apolloClient from 'graphql/client';
|
||||
import MUTATIONS from 'graphql/mutations';
|
||||
|
||||
export const processMutation = async (mutationName, variables) => {
|
||||
const mutation = MUTATIONS[mutationName];
|
||||
const mutationResponse = await apolloClient.mutate({
|
||||
mutation,
|
||||
variables: { input: variables },
|
||||
context: {
|
||||
autoSnackbar: false,
|
||||
},
|
||||
});
|
||||
const responseData = mutationResponse.data[mutationName];
|
||||
|
||||
return responseData;
|
||||
};
|
||||
|
||||
const parseUrlSearchParams = (event) => {
|
||||
const searchParams = new URLSearchParams(event.data.payload.search);
|
||||
const hashParams = new URLSearchParams(event.data.payload.hash.substring(1));
|
||||
|
@@ -2,7 +2,6 @@ import * as React from 'react';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
|
||||
import {
|
||||
processMutation,
|
||||
processOpenWithPopup,
|
||||
processPopupMessage,
|
||||
} from 'helpers/authenticationSteps';
|
||||
@@ -100,9 +99,6 @@ export default function useAuthenticateApp(payload) {
|
||||
response.connectionId,
|
||||
);
|
||||
response[step.name] = stepResponse?.data;
|
||||
} else {
|
||||
const stepResponse = await processMutation(step.name, variables);
|
||||
response[step.name] = stepResponse;
|
||||
}
|
||||
} else if (step.type === 'openWithPopup') {
|
||||
const stepResponse = await processPopupMessage(popup);
|
||||
|
Reference in New Issue
Block a user