Skip to content

Commit 18fa55c

Browse files
committed
chore: fix test for forward relation with compound key
1 parent 4f3853a commit 18fa55c

File tree

6 files changed

+31
-140
lines changed

6 files changed

+31
-140
lines changed

__tests__/integration/schema/__snapshots__/connectionFilter.test.js.snap

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -599,34 +599,10 @@ type Forward implements Node {
599599
}
600600
601601
type ForwardCompound implements Node {
602-
\\"\\"\\"Reads and enables pagination through a set of \`Filterable\`.\\"\\"\\"
603-
filterablesByForwardCompound1AndForwardCompound2(
604-
\\"\\"\\"Read all values in the set after (below) this cursor.\\"\\"\\"
605-
after: Cursor
606-
607-
\\"\\"\\"Read all values in the set before (above) this cursor.\\"\\"\\"
608-
before: Cursor
609-
610-
\\"\\"\\"
611-
A filter to be used in determining which values should be returned by the collection.
612-
\\"\\"\\"
613-
filter: FilterableFilter
614-
615-
\\"\\"\\"Only read the first \`n\` values of the set.\\"\\"\\"
616-
first: Int
617-
618-
\\"\\"\\"Only read the last \`n\` values of the set.\\"\\"\\"
619-
last: Int
620-
621-
\\"\\"\\"
622-
Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor
623-
based pagination. May not be used with \`last\`.
624-
\\"\\"\\"
625-
offset: Int
626-
627-
\\"\\"\\"The method to use when ordering \`Filterable\`.\\"\\"\\"
628-
orderBy: [FilterablesOrderBy!] = [PRIMARY_KEY_ASC]
629-
): FilterablesConnection!
602+
\\"\\"\\"
603+
Reads a single \`Filterable\` that is related to this \`ForwardCompound\`.
604+
\\"\\"\\"
605+
filterableByForwardCompound1AndForwardCompound2: Filterable
630606
forwardCompound1: Int!
631607
forwardCompound2: Int!
632608
name: String
@@ -1438,6 +1414,7 @@ type Query implements Node {
14381414
nodeId: ID!
14391415
): Filterable
14401416
filterableByBackwardCompound1AndBackwardCompound2(backwardCompound1: Int!, backwardCompound2: Int!): Filterable
1417+
filterableByForwardCompound1AndForwardCompound2(forwardCompound1: Int!, forwardCompound2: Int!): Filterable
14411418
filterableByForwardId(forwardId: Int!): Filterable
14421419
filterableById(id: Int!): Filterable
14431420

__tests__/integration/schema/__snapshots__/connectionFilterAllowedOperators.test.js.snap

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -549,34 +549,10 @@ type Forward implements Node {
549549
}
550550
551551
type ForwardCompound implements Node {
552-
\\"\\"\\"Reads and enables pagination through a set of \`Filterable\`.\\"\\"\\"
553-
filterablesByForwardCompound1AndForwardCompound2(
554-
\\"\\"\\"Read all values in the set after (below) this cursor.\\"\\"\\"
555-
after: Cursor
556-
557-
\\"\\"\\"Read all values in the set before (above) this cursor.\\"\\"\\"
558-
before: Cursor
559-
560-
\\"\\"\\"
561-
A filter to be used in determining which values should be returned by the collection.
562-
\\"\\"\\"
563-
filter: FilterableFilter
564-
565-
\\"\\"\\"Only read the first \`n\` values of the set.\\"\\"\\"
566-
first: Int
567-
568-
\\"\\"\\"Only read the last \`n\` values of the set.\\"\\"\\"
569-
last: Int
570-
571-
\\"\\"\\"
572-
Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor
573-
based pagination. May not be used with \`last\`.
574-
\\"\\"\\"
575-
offset: Int
576-
577-
\\"\\"\\"The method to use when ordering \`Filterable\`.\\"\\"\\"
578-
orderBy: [FilterablesOrderBy!] = [PRIMARY_KEY_ASC]
579-
): FilterablesConnection!
552+
\\"\\"\\"
553+
Reads a single \`Filterable\` that is related to this \`ForwardCompound\`.
554+
\\"\\"\\"
555+
filterableByForwardCompound1AndForwardCompound2: Filterable
580556
forwardCompound1: Int!
581557
forwardCompound2: Int!
582558
name: String
@@ -1227,6 +1203,7 @@ type Query implements Node {
12271203
nodeId: ID!
12281204
): Filterable
12291205
filterableByBackwardCompound1AndBackwardCompound2(backwardCompound1: Int!, backwardCompound2: Int!): Filterable
1206+
filterableByForwardCompound1AndForwardCompound2(forwardCompound1: Int!, forwardCompound2: Int!): Filterable
12301207
filterableByForwardId(forwardId: Int!): Filterable
12311208
filterableById(id: Int!): Filterable
12321209

__tests__/integration/schema/__snapshots__/connectionFilterListsFalse.test.js.snap

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -593,34 +593,10 @@ type Forward implements Node {
593593
}
594594
595595
type ForwardCompound implements Node {
596-
\\"\\"\\"Reads and enables pagination through a set of \`Filterable\`.\\"\\"\\"
597-
filterablesByForwardCompound1AndForwardCompound2(
598-
\\"\\"\\"Read all values in the set after (below) this cursor.\\"\\"\\"
599-
after: Cursor
600-
601-
\\"\\"\\"Read all values in the set before (above) this cursor.\\"\\"\\"
602-
before: Cursor
603-
604-
\\"\\"\\"
605-
A filter to be used in determining which values should be returned by the collection.
606-
\\"\\"\\"
607-
filter: FilterableFilter
608-
609-
\\"\\"\\"Only read the first \`n\` values of the set.\\"\\"\\"
610-
first: Int
611-
612-
\\"\\"\\"Only read the last \`n\` values of the set.\\"\\"\\"
613-
last: Int
614-
615-
\\"\\"\\"
616-
Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor
617-
based pagination. May not be used with \`last\`.
618-
\\"\\"\\"
619-
offset: Int
620-
621-
\\"\\"\\"The method to use when ordering \`Filterable\`.\\"\\"\\"
622-
orderBy: [FilterablesOrderBy!] = [PRIMARY_KEY_ASC]
623-
): FilterablesConnection!
596+
\\"\\"\\"
597+
Reads a single \`Filterable\` that is related to this \`ForwardCompound\`.
598+
\\"\\"\\"
599+
filterableByForwardCompound1AndForwardCompound2: Filterable
624600
forwardCompound1: Int!
625601
forwardCompound2: Int!
626602
name: String
@@ -1369,6 +1345,7 @@ type Query implements Node {
13691345
nodeId: ID!
13701346
): Filterable
13711347
filterableByBackwardCompound1AndBackwardCompound2(backwardCompound1: Int!, backwardCompound2: Int!): Filterable
1348+
filterableByForwardCompound1AndForwardCompound2(forwardCompound1: Int!, forwardCompound2: Int!): Filterable
13721349
filterableByForwardId(forwardId: Int!): Filterable
13731350
filterableById(id: Int!): Filterable
13741351

__tests__/integration/schema/__snapshots__/connectionFilterOperatorNames.test.js.snap

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -599,34 +599,10 @@ type Forward implements Node {
599599
}
600600
601601
type ForwardCompound implements Node {
602-
\\"\\"\\"Reads and enables pagination through a set of \`Filterable\`.\\"\\"\\"
603-
filterablesByForwardCompound1AndForwardCompound2(
604-
\\"\\"\\"Read all values in the set after (below) this cursor.\\"\\"\\"
605-
after: Cursor
606-
607-
\\"\\"\\"Read all values in the set before (above) this cursor.\\"\\"\\"
608-
before: Cursor
609-
610-
\\"\\"\\"
611-
A filter to be used in determining which values should be returned by the collection.
612-
\\"\\"\\"
613-
filter: FilterableFilter
614-
615-
\\"\\"\\"Only read the first \`n\` values of the set.\\"\\"\\"
616-
first: Int
617-
618-
\\"\\"\\"Only read the last \`n\` values of the set.\\"\\"\\"
619-
last: Int
620-
621-
\\"\\"\\"
622-
Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor
623-
based pagination. May not be used with \`last\`.
624-
\\"\\"\\"
625-
offset: Int
626-
627-
\\"\\"\\"The method to use when ordering \`Filterable\`.\\"\\"\\"
628-
orderBy: [FilterablesOrderBy!] = [PRIMARY_KEY_ASC]
629-
): FilterablesConnection!
602+
\\"\\"\\"
603+
Reads a single \`Filterable\` that is related to this \`ForwardCompound\`.
604+
\\"\\"\\"
605+
filterableByForwardCompound1AndForwardCompound2: Filterable
630606
forwardCompound1: Int!
631607
forwardCompound2: Int!
632608
name: String
@@ -1438,6 +1414,7 @@ type Query implements Node {
14381414
nodeId: ID!
14391415
): Filterable
14401416
filterableByBackwardCompound1AndBackwardCompound2(backwardCompound1: Int!, backwardCompound2: Int!): Filterable
1417+
filterableByForwardCompound1AndForwardCompound2(forwardCompound1: Int!, forwardCompound2: Int!): Filterable
14411418
filterableByForwardId(forwardId: Int!): Filterable
14421419
filterableById(id: Int!): Filterable
14431420

__tests__/integration/schema/__snapshots__/connectionFilterRelationsTrue.test.js.snap

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -629,34 +629,10 @@ type Forward implements Node {
629629
}
630630
631631
type ForwardCompound implements Node {
632-
\\"\\"\\"Reads and enables pagination through a set of \`Filterable\`.\\"\\"\\"
633-
filterablesByForwardCompound1AndForwardCompound2(
634-
\\"\\"\\"Read all values in the set after (below) this cursor.\\"\\"\\"
635-
after: Cursor
636-
637-
\\"\\"\\"Read all values in the set before (above) this cursor.\\"\\"\\"
638-
before: Cursor
639-
640-
\\"\\"\\"
641-
A filter to be used in determining which values should be returned by the collection.
642-
\\"\\"\\"
643-
filter: FilterableFilter
644-
645-
\\"\\"\\"Only read the first \`n\` values of the set.\\"\\"\\"
646-
first: Int
647-
648-
\\"\\"\\"Only read the last \`n\` values of the set.\\"\\"\\"
649-
last: Int
650-
651-
\\"\\"\\"
652-
Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor
653-
based pagination. May not be used with \`last\`.
654-
\\"\\"\\"
655-
offset: Int
656-
657-
\\"\\"\\"The method to use when ordering \`Filterable\`.\\"\\"\\"
658-
orderBy: [FilterablesOrderBy!] = [PRIMARY_KEY_ASC]
659-
): FilterablesConnection!
632+
\\"\\"\\"
633+
Reads a single \`Filterable\` that is related to this \`ForwardCompound\`.
634+
\\"\\"\\"
635+
filterableByForwardCompound1AndForwardCompound2: Filterable
660636
forwardCompound1: Int!
661637
forwardCompound2: Int!
662638
name: String
@@ -674,6 +650,11 @@ input ForwardCompoundFilter {
674650
\\"\\"\\"Checks for all expressions in this list.\\"\\"\\"
675651
and: [ForwardCompoundFilter!]
676652
653+
\\"\\"\\"
654+
Filter by the object’s \`filterableByForwardCompound1AndForwardCompound2\` field.
655+
\\"\\"\\"
656+
filterableByForwardCompound1AndForwardCompound2: FilterableFilter
657+
677658
\\"\\"\\"Filter by the object’s \`forwardCompound1\` field.\\"\\"\\"
678659
forwardCompound1: IntFilter
679660
@@ -1471,6 +1452,7 @@ type Query implements Node {
14711452
nodeId: ID!
14721453
): Filterable
14731454
filterableByBackwardCompound1AndBackwardCompound2(backwardCompound1: Int!, backwardCompound2: Int!): Filterable
1455+
filterableByForwardCompound1AndForwardCompound2(forwardCompound1: Int!, forwardCompound2: Int!): Filterable
14741456
filterableByForwardId(forwardId: Int!): Filterable
14751457
filterableById(id: Int!): Filterable
14761458

__tests__/p-schema.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ create table p.filterable (
3838
"forward_compound_2" int,
3939
"backward_compound_1" int,
4040
"backward_compound_2" int,
41+
unique ("forward_compound_1", "forward_compound_2"),
4142
unique ("backward_compound_1", "backward_compound_2"),
4243
foreign key ("forward_compound_1", "forward_compound_2") references p.forward_compound ("forward_compound_1", "forward_compound_2")
4344
);

0 commit comments

Comments
 (0)