1ad8c05fbc
groupBy fix: when a group's dimension value is NULL, we need to adapt the raw sql (stage: NULL -> stage IS NULL) typeMapper fix: a graphql type should be made non-nullable if was indicated so + does not have a default value. our check on not having a default value was limited to having a null defaultValue instead of having a null or undefined defaultValue. This is a breaking change, but all the queries that were providing a null value for these args were not functioning anyway, and luckily in the FE we declared all queries adding a `!` already.
29 lines
787 B
TypeScript
29 lines
787 B
TypeScript
import gql from 'graphql-tag';
|
|
import { capitalize } from 'twenty-shared/utils';
|
|
|
|
type UpdateOneOperationFactoryParams = {
|
|
objectMetadataSingularName: string;
|
|
gqlFields: string;
|
|
data?: object;
|
|
recordId: string;
|
|
};
|
|
|
|
export const updateOneOperationFactory = ({
|
|
objectMetadataSingularName,
|
|
gqlFields,
|
|
data = {},
|
|
recordId,
|
|
}: UpdateOneOperationFactoryParams) => ({
|
|
query: gql`
|
|
mutation Update${capitalize(objectMetadataSingularName)}($${objectMetadataSingularName}Id: UUID!, $data: ${capitalize(objectMetadataSingularName)}UpdateInput!) {
|
|
update${capitalize(objectMetadataSingularName)}(id: $${objectMetadataSingularName}Id, data: $data) {
|
|
${gqlFields}
|
|
}
|
|
}
|
|
`,
|
|
variables: {
|
|
data,
|
|
[`${objectMetadataSingularName}Id`]: recordId,
|
|
},
|
|
});
|