feat: add app connections w/ testing and deleting functions
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { GraphQLString, GraphQLNonNull } from 'graphql';
|
||||
import Connection from '../../models/connection';
|
||||
import App from '../../models/app';
|
||||
import connectionType from '../types/connection';
|
||||
import twitterCredentialInputType from '../types/twitter-credential-input';
|
||||
import RequestWithCurrentUser from '../../types/express/request-with-current-user';
|
||||
@@ -9,13 +10,17 @@ type Params = {
|
||||
data: object
|
||||
}
|
||||
const createConnectionResolver = async (params: Params, req: RequestWithCurrentUser) => {
|
||||
const app = await App.findOneByKey(params.key);
|
||||
const connection = await Connection.query().insert({
|
||||
key: params.key,
|
||||
data: params.data,
|
||||
userId: req.currentUser.id
|
||||
});
|
||||
|
||||
return connection;
|
||||
return {
|
||||
...connection,
|
||||
app,
|
||||
};
|
||||
}
|
||||
|
||||
const createConnection = {
|
||||
|
Reference in New Issue
Block a user