Skip to content

Commit 9f0d2d4

Browse files
committed
Update snapshots
1 parent 92781a1 commit 9f0d2d4

File tree

2 files changed

+125
-6
lines changed

2 files changed

+125
-6
lines changed

postgraphile/postgraphile/__tests__/schema/v4/indexes.1.export.mjs

Lines changed: 91 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -859,8 +859,7 @@ const spec_uniqueForeignKey = {
859859
notNull: false,
860860
hasDefault: false,
861861
extensions: {
862-
tags: {},
863-
isIndexed: false
862+
tags: {}
864863
}
865864
}
866865
},
@@ -1067,8 +1066,7 @@ const compoundKeyCodec = recordCodec({
10671066
notNull: true,
10681067
hasDefault: false,
10691068
extensions: {
1070-
tags: {},
1071-
isIndexed: false
1069+
tags: {}
10721070
}
10731071
},
10741072
person_id_1: {
@@ -9613,8 +9611,7 @@ const registry = makeRegistry({
96139611
extensions: {
96149612
tags: {
96159613
behavior: []
9616-
},
9617-
isIndexed: false
9614+
}
96189615
}
96199616
}
96209617
},
@@ -13350,6 +13347,35 @@ type Person implements Node {
1335013347
"""The method to use when ordering \`CompoundKey\`."""
1335113348
orderBy: [CompoundKeysOrderBy!] = [PRIMARY_KEY_ASC]
1335213349
): CompoundKeysConnection!
13350+
13351+
"""Reads and enables pagination through a set of \`CompoundKey\`."""
13352+
compoundKeysByPersonId2(
13353+
"""Only read the first \`n\` values of the set."""
13354+
first: Int
13355+
13356+
"""Only read the last \`n\` values of the set."""
13357+
last: Int
13358+
13359+
"""
13360+
Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor
13361+
based pagination. May not be used with \`last\`.
13362+
"""
13363+
offset: Int
13364+
13365+
"""Read all values in the set before (above) this cursor."""
13366+
before: Cursor
13367+
13368+
"""Read all values in the set after (below) this cursor."""
13369+
after: Cursor
13370+
13371+
"""
13372+
A condition to be used in determining which values should be returned by the collection.
13373+
"""
13374+
condition: CompoundKeyCondition
13375+
13376+
"""The method to use when ordering \`CompoundKey\`."""
13377+
orderBy: [CompoundKeysOrderBy!] = [PRIMARY_KEY_ASC]
13378+
): CompoundKeysConnection!
1335313379
}
1335413380

1335513381
type PersonComputedOutOutRecord {
@@ -14046,6 +14072,9 @@ A condition to be used against \`CompoundKey\` object types. All fields are test
1404614072
for equality and combined with a logical ‘and.’
1404714073
"""
1404814074
input CompoundKeyCondition {
14075+
"""Checks for equality with the object’s \`personId2\` field."""
14076+
personId2: Int
14077+
1404914078
"""Checks for equality with the object’s \`personId1\` field."""
1405014079
personId1: Int
1405114080
}
@@ -14055,6 +14084,8 @@ enum CompoundKeysOrderBy {
1405514084
NATURAL
1405614085
PRIMARY_KEY_ASC
1405714086
PRIMARY_KEY_DESC
14087+
PERSON_ID_2_ASC
14088+
PERSON_ID_2_DESC
1405814089
PERSON_ID_1_ASC
1405914090
PERSON_ID_1_DESC
1406014091
}
@@ -28627,6 +28658,39 @@ export const objects = {
2862728658
}
2862828659
}
2862928660
},
28661+
compoundKeysByPersonId2: {
28662+
plan($record) {
28663+
const $records = resource_compound_keyPgResource.find({
28664+
person_id_2: $record.get("id")
28665+
});
28666+
return connection($records);
28667+
},
28668+
args: {
28669+
first(_, $connection, arg) {
28670+
$connection.setFirst(arg.getRaw());
28671+
},
28672+
last(_, $connection, val) {
28673+
$connection.setLast(val.getRaw());
28674+
},
28675+
offset(_, $connection, val) {
28676+
$connection.setOffset(val.getRaw());
28677+
},
28678+
before(_, $connection, val) {
28679+
$connection.setBefore(val.getRaw());
28680+
},
28681+
after(_, $connection, val) {
28682+
$connection.setAfter(val.getRaw());
28683+
},
28684+
condition(_condition, $connection, arg) {
28685+
const $select = $connection.getSubplan();
28686+
arg.apply($select, qbWhereBuilder);
28687+
},
28688+
orderBy(parent, $connection, value) {
28689+
const $select = $connection.getSubplan();
28690+
value.apply($select);
28691+
}
28692+
}
28693+
},
2863028694
computedComplex($in, args, _info) {
2863128695
const {
2863228696
selectArgs
@@ -30087,6 +30151,15 @@ export const inputObjects = {
3008730151
return val === null ? sql`${expression} is null` : sql`${expression} = ${sqlValueWithCodec(val, TYPES.int)}`;
3008830152
}
3008930153
});
30154+
},
30155+
personId2($condition, val) {
30156+
$condition.where({
30157+
type: "attribute",
30158+
attribute: "person_id_2",
30159+
callback(expression) {
30160+
return val === null ? sql`${expression} is null` : sql`${expression} = ${sqlValueWithCodec(val, TYPES.int)}`;
30161+
}
30162+
});
3009030163
}
3009130164
}
3009230165
},
@@ -34091,6 +34164,18 @@ export const enums = {
3409134164
});
3409234165
queryBuilder.setOrderIsUnique();
3409334166
},
34167+
PERSON_ID_2_ASC(queryBuilder) {
34168+
queryBuilder.orderBy({
34169+
attribute: "person_id_2",
34170+
direction: "ASC"
34171+
});
34172+
},
34173+
PERSON_ID_2_DESC(queryBuilder) {
34174+
queryBuilder.orderBy({
34175+
attribute: "person_id_2",
34176+
direction: "DESC"
34177+
});
34178+
},
3409434179
PRIMARY_KEY_ASC(queryBuilder) {
3409534180
compound_keyUniques[0].attributes.forEach(attributeName => {
3409634181
queryBuilder.orderBy({

postgraphile/postgraphile/__tests__/schema/v4/indexes.1.graphql

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,9 @@ for equality and combined with a logical ‘and.’
410410
input CompoundKeyCondition {
411411
"""Checks for equality with the object’s `personId1` field."""
412412
personId1: Int
413+
414+
"""Checks for equality with the object’s `personId2` field."""
415+
personId2: Int
413416
}
414417

415418
"""An input for mutations affecting `CompoundKey`"""
@@ -459,6 +462,8 @@ enum CompoundKeysOrderBy {
459462
NATURAL
460463
PERSON_ID_1_ASC
461464
PERSON_ID_1_DESC
465+
PERSON_ID_2_ASC
466+
PERSON_ID_2_DESC
462467
PRIMARY_KEY_ASC
463468
PRIMARY_KEY_DESC
464469
}
@@ -5903,6 +5908,35 @@ type Person implements Node {
59035908
"""The method to use when ordering `CompoundKey`."""
59045909
orderBy: [CompoundKeysOrderBy!] = [PRIMARY_KEY_ASC]
59055910
): CompoundKeysConnection!
5911+
5912+
"""Reads and enables pagination through a set of `CompoundKey`."""
5913+
compoundKeysByPersonId2(
5914+
"""Read all values in the set after (below) this cursor."""
5915+
after: Cursor
5916+
5917+
"""Read all values in the set before (above) this cursor."""
5918+
before: Cursor
5919+
5920+
"""
5921+
A condition to be used in determining which values should be returned by the collection.
5922+
"""
5923+
condition: CompoundKeyCondition
5924+
5925+
"""Only read the first `n` values of the set."""
5926+
first: Int
5927+
5928+
"""Only read the last `n` values of the set."""
5929+
last: Int
5930+
5931+
"""
5932+
Skip the first `n` values from our `after` cursor, an alternative to cursor
5933+
based pagination. May not be used with `last`.
5934+
"""
5935+
offset: Int
5936+
5937+
"""The method to use when ordering `CompoundKey`."""
5938+
orderBy: [CompoundKeysOrderBy!] = [PRIMARY_KEY_ASC]
5939+
): CompoundKeysConnection!
59065940
computedComplex(a: Int, b: String): PersonComputedComplexRecord
59075941
computedFirstArgInout: Person
59085942
computedFirstArgInoutOut: PersonComputedFirstArgInoutOutRecord

0 commit comments

Comments
 (0)