refactor: Remove redundant getAppConnections query
This commit is contained in:
@@ -1,27 +0,0 @@
|
|||||||
import App from '../../models/app';
|
|
||||||
import Context from '../../types/express/context';
|
|
||||||
|
|
||||||
type Params = {
|
|
||||||
key: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
const getAppConnections = async (
|
|
||||||
_parent: unknown,
|
|
||||||
params: Params,
|
|
||||||
context: Context
|
|
||||||
) => {
|
|
||||||
const app = App.findOneByKey(params.key);
|
|
||||||
|
|
||||||
const connections = await context.currentUser
|
|
||||||
.$relatedQuery('connections')
|
|
||||||
.where({
|
|
||||||
key: params.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
return connections.map((connection) => ({
|
|
||||||
...connection,
|
|
||||||
app,
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
|
|
||||||
export default getAppConnections;
|
|
@@ -1,7 +1,6 @@
|
|||||||
import getApps from './queries/get-apps';
|
import getApps from './queries/get-apps';
|
||||||
import getApp from './queries/get-app';
|
import getApp from './queries/get-app';
|
||||||
import getConnectedApps from './queries/get-connected-apps';
|
import getConnectedApps from './queries/get-connected-apps';
|
||||||
import getAppConnections from './queries/get-app-connections';
|
|
||||||
import testConnection from './queries/test-connection';
|
import testConnection from './queries/test-connection';
|
||||||
import getFlow from './queries/get-flow';
|
import getFlow from './queries/get-flow';
|
||||||
import getFlows from './queries/get-flows';
|
import getFlows from './queries/get-flows';
|
||||||
@@ -15,7 +14,6 @@ const queryResolvers = {
|
|||||||
getApps,
|
getApps,
|
||||||
getApp,
|
getApp,
|
||||||
getConnectedApps,
|
getConnectedApps,
|
||||||
getAppConnections,
|
|
||||||
testConnection,
|
testConnection,
|
||||||
getFlow,
|
getFlow,
|
||||||
getFlows,
|
getFlows,
|
||||||
|
@@ -2,7 +2,6 @@ type Query {
|
|||||||
getApps(name: String, onlyWithTriggers: Boolean): [App]
|
getApps(name: String, onlyWithTriggers: Boolean): [App]
|
||||||
getApp(key: AvailableAppsEnumType!): App
|
getApp(key: AvailableAppsEnumType!): App
|
||||||
getConnectedApps(name: String): [App]
|
getConnectedApps(name: String): [App]
|
||||||
getAppConnections(key: AvailableAppsEnumType!): [Connection]
|
|
||||||
testConnection(id: String!): Connection
|
testConnection(id: String!): Connection
|
||||||
getFlow(id: String!): Flow
|
getFlow(id: String!): Flow
|
||||||
getFlows(appKey: String): [Flow]
|
getFlows(appKey: String): [Flow]
|
||||||
|
Reference in New Issue
Block a user