Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`client-generator generateCreateClientFile generates createClient factory with models 1`] = `
"/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`generateInputTypesFile generates complete types file for multiple tables with relations 1`] = `
"/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`model-generator generates model with all CRUD methods 1`] = `
"/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`generateInvalidationFile generates invalidation helpers for a single table without relationships 1`] = `
"/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`Barrel File Generators generateCustomMutationsBarrel generates custom mutations barrel 1`] = `
"/**
Expand Down Expand Up @@ -770,7 +770,6 @@ export const deleteUserMutationDocument = \`
mutation DeleteUserMutation($input: DeleteUserInput!) {
deleteUser(input: $input) {
clientMutationId
deletedId
}
}
\`;
Expand All @@ -782,7 +781,6 @@ export interface DeleteUserMutationVariables {
export interface DeleteUserMutationResult {
deleteUser: {
clientMutationId: string | null;
deletedId: string | null;
};
}
/**
Expand Down Expand Up @@ -834,7 +832,6 @@ export const deletePostMutationDocument = \`
mutation DeletePostMutation($input: DeletePostInput!) {
deletePost(input: $input) {
clientMutationId
deletedId
}
}
\`;
Expand All @@ -846,7 +843,6 @@ export interface DeletePostMutationVariables {
export interface DeletePostMutationResult {
deletePost: {
clientMutationId: string | null;
deletedId: string | null;
};
}
/**
Expand Down Expand Up @@ -895,7 +891,6 @@ export const deleteUserMutationDocument = \`
mutation DeleteUserMutation($input: DeleteUserInput!) {
deleteUser(input: $input) {
clientMutationId
deletedId
}
}
\`;
Expand All @@ -907,7 +902,6 @@ export interface DeleteUserMutationVariables {
export interface DeleteUserMutationResult {
deleteUser: {
clientMutationId: string | null;
deletedId: string | null;
};
}
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`schema-types-generator generates enum types as string unions 1`] = `
"/**
Expand Down
1 change: 0 additions & 1 deletion graphql/codegen/src/cli/codegen/gql-ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ export function buildDeleteMutationAST(config: DeleteMutationConfig): DocumentNo
selectionSet: t.selectionSet({
selections: [
t.field({ name: 'clientMutationId' }),
t.field({ name: 'deletedId' }),
],
}),
}),
Expand Down
6 changes: 1 addition & 5 deletions graphql/codegen/src/cli/codegen/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -792,10 +792,6 @@ export function generateDeleteMutationHook(
);
statements.push(t.exportNamedDeclaration(variablesInterface));

const deletedPkProp = t.tsPropertySignature(
t.identifier(`deleted${ucFirst(pkField.name)}`),
t.tsTypeAnnotation(t.tsUnionType([pkTypeAnnotation, t.tsNullKeyword()]))
);
const clientMutationIdProp = t.tsPropertySignature(
t.identifier('clientMutationId'),
t.tsTypeAnnotation(t.tsUnionType([t.tsStringKeyword(), t.tsNullKeyword()]))
Expand All @@ -804,7 +800,7 @@ export function generateDeleteMutationHook(
const resultInterfaceBody = t.tsInterfaceBody([
t.tsPropertySignature(
t.identifier(mutationName),
t.tsTypeAnnotation(t.tsTypeLiteral([clientMutationIdProp, deletedPkProp]))
t.tsTypeAnnotation(t.tsTypeLiteral([clientMutationIdProp]))
),
]);
const resultInterface = t.tsInterfaceDeclaration(
Expand Down