Skip to content

Commit

Permalink
More notNull tests
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Dec 7, 2018
1 parent 28ce94f commit f8c57c1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7370,6 +7370,32 @@ Object {
},
},
},
Object {
"buildingByBuildingId": null,
"buildingId": null,
"buildingName": null,
"propertyByPropertyId": Object {
"id": 2,
"nameOrNumber": "10",
"nodeId": "WyJwcm9wZXJ0aWVzIiwyXQ==",
"streetByStreetId": Object {
"id": 1,
"name": "My Street",
"nodeId": "WyJzdHJlZXRzIiwxXQ==",
},
"streetId": 1,
},
"propertyId": 2,
"propertyNameOrNumber": "10",
"streetByStreetId": Object {
"id": 1,
"name": "My Street",
"nodeId": "WyJzdHJlZXRzIiwxXQ==",
},
"streetId": 1,
"streetName": "My Street",
"streetPropertyByStreetIdAndPropertyId": null,
},
Object {
"buildingByBuildingId": Object {
"floors": 3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,12 +505,12 @@ type House implements Node {
\\"\\"\\"Reads a single \`Property\` that is related to this \`House\`.\\"\\"\\"
propertyByPropertyId: Property
propertyId: Int!
propertyNameOrNumber: String
propertyNameOrNumber: String!
\\"\\"\\"Reads a single \`Street\` that is related to this \`House\`.\\"\\"\\"
streetByStreetId: Street
streetId: Int!
streetName: String
streetName: String!
\\"\\"\\"Reads a single \`StreetProperty\` that is related to this \`House\`.\\"\\"\\"
streetPropertyByStreetIdAndPropertyId: StreetProperty
Expand Down
7 changes: 5 additions & 2 deletions packages/postgraphile-core/__tests__/kitchen-sink-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -903,14 +903,17 @@ create view smart_comment_relations.houses as (
properties.id as property_id,
buildings.floors
from smart_comment_relations.properties
inner join smart_comment_relations.buildings
on (buildings.property_id = properties.id and buildings.is_primary is true)
inner join smart_comment_relations.streets
on (properties.street_id = streets.id)
left join smart_comment_relations.buildings
on (buildings.property_id = properties.id and buildings.is_primary is true)
);
comment on view smart_comment_relations.houses is E'@primaryKey street_id,property_id
@foreignKey (street_id) references smart_comment_relations.streets
@foreignKey (building_id) references smart_comment_relations.buildings (id)
@foreignKey (property_id) references properties
@foreignKey (street_id, property_id) references street_property (str_id, prop_id)
';

comment on column smart_comment_relations.houses.property_name_or_number is E'@notNull';
comment on column smart_comment_relations.houses.street_name is E'@notNull';

0 comments on commit f8c57c1

Please sign in to comment.