Skip to content

Commit 10b5bc1

Browse files
authored
chore: revert breaking fake enum name change (#682)
1 parent 0747562 commit 10b5bc1

3 files changed

Lines changed: 21 additions & 22 deletions

File tree

packages/graphile-build-pg/src/plugins/PgIntrospectionPlugin.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,8 +715,7 @@ Original error: ${e.message}
715715

716716
// Create fake enum type
717717
const constraintIdent =
718-
(constraint.type === "p" ? "" : `_${constraint.name}`) +
719-
"_fake_enum";
718+
constraint.type === "p" ? "" : `_${constraint.name}`;
720719
const enumTypeArray = {
721720
kind: "type",
722721
isFake: true,

packages/postgraphile-core/__tests__/integration/schema/__snapshots__/enum_tables.test.js.snap

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -208,20 +208,6 @@ enum EnumTheSecond {
208208
B4
209209
}
210210
211-
enum EnumTheThird {
212-
"""Desc C1"""
213-
C1
214-
215-
"""Desc C2"""
216-
C2
217-
218-
"""Desc C3"""
219-
C3
220-
221-
"""Desc C4"""
222-
C4
223-
}
224-
225211
enum LetterAToD {
226212
"""The letter A"""
227213
A
@@ -319,6 +305,20 @@ enum LetterDescriptionsOrderBy {
319305
PRIMARY_KEY_DESC
320306
}
321307
308+
enum LotsOfEnumsEnum3 {
309+
"""Desc C1"""
310+
C1
311+
312+
"""Desc C2"""
313+
C2
314+
315+
"""Desc C3"""
316+
C3
317+
318+
"""Desc C4"""
319+
C4
320+
}
321+
322322
"""
323323
The root mutation type which contains root level fields which mutate data.
324324
"""
@@ -553,7 +553,7 @@ type Query implements Node {
553553
type ReferencingTable implements Node {
554554
enum1: EnumTheFirst
555555
enum2: EnumTheSecond
556-
enum3: EnumTheThird
556+
enum3: LotsOfEnumsEnum3
557557
id: Int!
558558
559559
"""
@@ -574,7 +574,7 @@ input ReferencingTableCondition {
574574
enum2: EnumTheSecond
575575
576576
"""Checks for equality with the object’s \`enum3\` field."""
577-
enum3: EnumTheThird
577+
enum3: LotsOfEnumsEnum3
578578
579579
"""Checks for equality with the object’s \`id\` field."""
580580
id: Int
@@ -584,7 +584,7 @@ input ReferencingTableCondition {
584584
input ReferencingTableInput {
585585
enum1: EnumTheFirst
586586
enum2: EnumTheSecond
587-
enum3: EnumTheThird
587+
enum3: LotsOfEnumsEnum3
588588
id: Int
589589
}
590590
@@ -619,7 +619,7 @@ Represents an update to a \`ReferencingTable\`. Fields that are set will be upda
619619
input ReferencingTablePatch {
620620
enum1: EnumTheFirst
621621
enum2: EnumTheSecond
622-
enum3: EnumTheThird
622+
enum3: LotsOfEnumsEnum3
623623
id: Int
624624
}
625625

packages/postgraphile-core/__tests__/kitchen-sink-schema.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,8 +1165,8 @@ create table enum_tables.lots_of_enums (
11651165
comment on table enum_tables.lots_of_enums is E'@omit';
11661166
comment on constraint enum_1 on enum_tables.lots_of_enums is E'@enum\n@enumName EnumTheFirst';
11671167
comment on constraint enum_2 on enum_tables.lots_of_enums is E'@enum\n@enumName EnumTheSecond';
1168-
comment on constraint enum_3 on enum_tables.lots_of_enums is E'@enum\n@enumName EnumTheThird';
1169-
comment on constraint enum_4 on enum_tables.lots_of_enums is E'@enum\n@enumName EnumTheFourth';
1168+
comment on constraint enum_3 on enum_tables.lots_of_enums is E'@enum';
1169+
comment on constraint enum_4 on enum_tables.lots_of_enums is E'@enum';
11701170

11711171
-- Enum table needs values added as part of the migration, not as part of the
11721172
-- data.

0 commit comments

Comments
 (0)