fix: Introduce formattedData for connections to separate types
This commit is contained in:

committed by
Ömer Faruk Aydın

parent
39b50fc0d3
commit
719a948134
@@ -2,10 +2,11 @@ import { GraphQLString, GraphQLNonNull } from 'graphql';
|
||||
import { GraphQLJSONObject } from 'graphql-type-json';
|
||||
import connectionType from '../types/connection';
|
||||
import RequestWithCurrentUser from '../../types/express/request-with-current-user';
|
||||
import { IJSONObject } from '@automatisch/types';
|
||||
|
||||
type Params = {
|
||||
id: string;
|
||||
data: object;
|
||||
formattedData: IJSONObject;
|
||||
};
|
||||
|
||||
const updateConnectionResolver = async (
|
||||
@@ -20,9 +21,9 @@ const updateConnectionResolver = async (
|
||||
.throwIfNotFound();
|
||||
|
||||
connection = await connection.$query().patchAndFetch({
|
||||
data: {
|
||||
...connection.data,
|
||||
...params.data,
|
||||
formattedData: {
|
||||
...connection.formattedData,
|
||||
...params.formattedData,
|
||||
},
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user