diff --git a/config/schema/artifacts/data_warehouse.yaml b/config/schema/artifacts/data_warehouse.yaml index 6f1c02601..1112fd9f4 100644 --- a/config/schema/artifacts/data_warehouse.yaml +++ b/config/schema/artifacts/data_warehouse.yaml @@ -49,6 +49,22 @@ tables: voltage INT, manufacturer_id STRING ) + inspection_notes: + table_schema: |- + CREATE TABLE IF NOT EXISTS inspection_notes ( + id STRING, + widget_inspection_guid STRING, + note STRING, + created_at TIMESTAMP + ) + inspection_summaries: + table_schema: |- + CREATE TABLE IF NOT EXISTS inspection_summaries ( + id STRING, + widget_inspection_guid STRING, + summary STRING, + created_at TIMESTAMP + ) manufacturers: table_schema: |- CREATE TABLE IF NOT EXISTS manufacturers ( @@ -161,5 +177,6 @@ tables: amounts ARRAY, fees ARRAY>, metadata STRING, - workspace_name STRING + workspace_name STRING, + inspection STRUCT ) diff --git a/config/schema/artifacts/datastore_config.yaml b/config/schema/artifacts/datastore_config.yaml index 7fd1aebc7..b044c647f 100644 --- a/config/schema/artifacts/datastore_config.yaml +++ b/config/schema/artifacts/datastore_config.yaml @@ -1458,6 +1458,10 @@ index_templates: type: keyword workspace_name: type: keyword + inspection: + properties: + guid: + type: keyword __counts: properties: release_timestamps: @@ -1670,6 +1674,66 @@ indices: index.number_of_replicas: 1 index.number_of_shards: 1 index.max_result_window: 10000 + inspection_notes: + aliases: {} + mappings: + dynamic: strict + properties: + id: + type: keyword + widget_inspection_guid: + type: keyword + note: + type: keyword + created_at: + type: date + format: strict_date_time + __sources: + type: keyword + __versions: + type: object + dynamic: 'false' + __typename: + type: constant_keyword + value: InspectionNote + _size: + enabled: true + settings: + index.mapping.ignore_malformed: false + index.mapping.coerce: false + index.number_of_replicas: 1 + index.number_of_shards: 1 + index.max_result_window: 10000 + inspection_summaries: + aliases: {} + mappings: + dynamic: strict + properties: + id: + type: keyword + widget_inspection_guid: + type: keyword + summary: + type: keyword + created_at: + type: date + format: strict_date_time + __sources: + type: keyword + __versions: + type: object + dynamic: 'false' + __typename: + type: constant_keyword + value: InspectionSummary + _size: + enabled: true + settings: + index.mapping.ignore_malformed: false + index.mapping.coerce: false + index.number_of_replicas: 1 + index.number_of_shards: 1 + index.max_result_window: 10000 manufacturers: aliases: {} mappings: diff --git a/config/schema/artifacts/json_schemas.yaml b/config/schema/artifacts/json_schemas.yaml index 64c6f7129..ecdf9062b 100644 --- a/config/schema/artifacts/json_schemas.yaml +++ b/config/schema/artifacts/json_schemas.yaml @@ -28,6 +28,8 @@ json_schema_version: 1 - Component - DirectWholesaler - ElectricalPart + - InspectionNote + - InspectionSummary - Manufacturer - MechanicalPart - OnlineStore @@ -372,6 +374,62 @@ json_schema_version: 1 - coordinates ID: type: string + InspectionNote: + type: object + properties: + id: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + widget_inspection_guid: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + note: + anyOf: + - allOf: + - "$ref": "#/$defs/String" + - maxLength: 8191 + - type: 'null' + created_at: + "$ref": "#/$defs/DateTime" + __typename: + type: string + const: InspectionNote + default: InspectionNote + required: + - id + - widget_inspection_guid + - note + - created_at + InspectionSummary: + type: object + properties: + id: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + widget_inspection_guid: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + summary: + anyOf: + - allOf: + - "$ref": "#/$defs/String" + - maxLength: 8191 + - type: 'null' + created_at: + "$ref": "#/$defs/DateTime" + __typename: + type: string + const: InspectionSummary + default: InspectionSummary + required: + - id + - widget_inspection_guid + - summary + - created_at Int: type: integer minimum: -2147483648 @@ -1068,6 +1126,10 @@ json_schema_version: 1 - "$ref": "#/$defs/Untyped" - maxLength: 8191 - type: 'null' + inspection: + anyOf: + - "$ref": "#/$defs/WidgetInspection" + - type: 'null' __typename: type: string const: Widget @@ -1105,8 +1167,22 @@ json_schema_version: 1 - amounts - fees - metadata + - inspection description: For more performant queries on this type, please filter on `workspace_id` if possible. + WidgetInspection: + type: object + properties: + guid: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + __typename: + type: string + const: WidgetInspection + default: WidgetInspection + required: + - guid WidgetInternalDetails: type: object properties: diff --git a/config/schema/artifacts/json_schemas_by_version/v1.yaml b/config/schema/artifacts/json_schemas_by_version/v1.yaml index ad09ed3e1..0cc9dd4ab 100644 --- a/config/schema/artifacts/json_schemas_by_version/v1.yaml +++ b/config/schema/artifacts/json_schemas_by_version/v1.yaml @@ -28,6 +28,8 @@ json_schema_version: 1 - Component - DirectWholesaler - ElectricalPart + - InspectionNote + - InspectionSummary - Manufacturer - MechanicalPart - OnlineStore @@ -471,6 +473,86 @@ json_schema_version: 1 - coordinates ID: type: string + InspectionNote: + type: object + properties: + id: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + ElasticGraph: + type: ID! + nameInIndex: id + widget_inspection_guid: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + ElasticGraph: + type: ID! + nameInIndex: widget_inspection_guid + note: + anyOf: + - allOf: + - "$ref": "#/$defs/String" + - maxLength: 8191 + - type: 'null' + ElasticGraph: + type: String + nameInIndex: note + created_at: + "$ref": "#/$defs/DateTime" + ElasticGraph: + type: DateTime! + nameInIndex: created_at + __typename: + type: string + const: InspectionNote + default: InspectionNote + required: + - id + - widget_inspection_guid + - note + - created_at + InspectionSummary: + type: object + properties: + id: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + ElasticGraph: + type: ID! + nameInIndex: id + widget_inspection_guid: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + ElasticGraph: + type: ID! + nameInIndex: widget_inspection_guid + summary: + anyOf: + - allOf: + - "$ref": "#/$defs/String" + - maxLength: 8191 + - type: 'null' + ElasticGraph: + type: String + nameInIndex: summary + created_at: + "$ref": "#/$defs/DateTime" + ElasticGraph: + type: DateTime! + nameInIndex: created_at + __typename: + type: string + const: InspectionSummary + default: InspectionSummary + required: + - id + - widget_inspection_guid + - summary + - created_at Int: type: integer minimum: -2147483648 @@ -1476,6 +1558,13 @@ json_schema_version: 1 ElasticGraph: type: Untyped nameInIndex: metadata + inspection: + anyOf: + - "$ref": "#/$defs/WidgetInspection" + - type: 'null' + ElasticGraph: + type: WidgetInspection + nameInIndex: inspection __typename: type: string const: Widget @@ -1513,8 +1602,25 @@ json_schema_version: 1 - amounts - fees - metadata + - inspection description: For more performant queries on this type, please filter on `workspace_id` if possible. + WidgetInspection: + type: object + properties: + guid: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + ElasticGraph: + type: ID! + nameInIndex: guid + __typename: + type: string + const: WidgetInspection + default: WidgetInspection + required: + - guid WidgetInternalDetails: type: object properties: diff --git a/config/schema/artifacts/runtime_metadata.yaml b/config/schema/artifacts/runtime_metadata.yaml index 4990c3fe9..47bd99997 100644 --- a/config/schema/artifacts/runtime_metadata.yaml +++ b/config/schema/artifacts/runtime_metadata.yaml @@ -235,6 +235,74 @@ enum_types_by_name: sort_field: direction: desc field_path: voltage + InspectionNoteSortOrderInput: + values_by_name: + created_at_ASC: + sort_field: + direction: asc + field_path: created_at + created_at_DESC: + sort_field: + direction: desc + field_path: created_at + id_ASC: + sort_field: + direction: asc + field_path: id + id_DESC: + sort_field: + direction: desc + field_path: id + note_ASC: + sort_field: + direction: asc + field_path: note + note_DESC: + sort_field: + direction: desc + field_path: note + widget_inspection_guid_ASC: + sort_field: + direction: asc + field_path: widget_inspection_guid + widget_inspection_guid_DESC: + sort_field: + direction: desc + field_path: widget_inspection_guid + InspectionSummarySortOrderInput: + values_by_name: + created_at_ASC: + sort_field: + direction: asc + field_path: created_at + created_at_DESC: + sort_field: + direction: desc + field_path: created_at + id_ASC: + sort_field: + direction: asc + field_path: id + id_DESC: + sort_field: + direction: desc + field_path: id + summary_ASC: + sort_field: + direction: asc + field_path: summary + summary_DESC: + sort_field: + direction: desc + field_path: summary + widget_inspection_guid_ASC: + sort_field: + direction: asc + field_path: widget_inspection_guid + widget_inspection_guid_DESC: + sort_field: + direction: desc + field_path: widget_inspection_guid InventorSortOrderInput: values_by_name: id_ASC: @@ -523,6 +591,14 @@ enum_types_by_name: sort_field: direction: desc field_path: id + inspection_guid_ASC: + sort_field: + direction: asc + field_path: inspection.guid + inspection_guid_DESC: + sort_field: + direction: desc + field_path: inspection.guid internal_details_name_ASC: sort_field: direction: asc @@ -1215,6 +1291,14 @@ enum_types_by_name: sort_field: direction: desc field_path: id + inspection_guid_ASC: + sort_field: + direction: asc + field_path: inspection.guid + inspection_guid_DESC: + sort_field: + direction: desc + field_path: inspection.guid internal_details_name_ASC: sort_field: direction: asc @@ -1537,6 +1621,14 @@ enum_types_by_name: sort_field: direction: desc field_path: id + inspection_guid_ASC: + sort_field: + direction: asc + field_path: inspection.guid + inspection_guid_DESC: + sort_field: + direction: desc + field_path: inspection.guid internal_details_name_ASC: sort_field: direction: asc @@ -1912,6 +2004,38 @@ index_definitions_by_name: voltage: source: __self route_with: id + inspection_notes: + current_sources: + - __self + default_sort_fields: + - direction: desc + field_path: created_at + fields_by_path: + created_at: + source: __self + id: + source: __self + note: + source: __self + widget_inspection_guid: + source: __self + route_with: id + inspection_summaries: + current_sources: + - __self + default_sort_fields: + - direction: desc + field_path: created_at + fields_by_path: + created_at: + source: __self + id: + source: __self + summary: + source: __self + widget_inspection_guid: + source: __self + route_with: id manufacturers: current_sources: - __self @@ -2982,6 +3106,8 @@ index_definitions_by_name: source: __self id: source: __self + inspection.guid: + source: __self internal_details.name: source: __self internal_highlightable_details.name: @@ -3060,6 +3186,7 @@ object_types_by_name: relation: direction: out foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships shapes: @@ -3337,6 +3464,7 @@ object_types_by_name: - 100 direction: in foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships id: @@ -3349,12 +3477,14 @@ object_types_by_name: relation: direction: out foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships parts: relation: direction: out foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships position: @@ -3367,12 +3497,14 @@ object_types_by_name: relation: direction: in foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships widget_aggregations: relation: direction: in foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships widget_cost: @@ -3395,6 +3527,7 @@ object_types_by_name: relation: direction: in foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships index_definition_names: @@ -3854,12 +3987,14 @@ object_types_by_name: relation: direction: in foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships components: relation: direction: in foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships created_at: @@ -3872,6 +4007,7 @@ object_types_by_name: relation: direction: out foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships name: @@ -4058,6 +4194,286 @@ object_types_by_name: graphql_fields_by_name: count: name_in_index: __counts + InspectionNote: + graphql_fields_by_name: + created_at: + resolver: + name: get_record_field_value + id: + resolver: + name: get_record_field_value + note: + resolver: + name: get_record_field_value + widget_inspection_guid: + resolver: + name: get_record_field_value + index_definition_names: + - inspection_notes + update_targets: + - data_params: + created_at: + cardinality: one + note: + cardinality: one + widget_inspection_guid: + cardinality: one + id_source: id + metadata_params: + relationship: + value: __self + sourceId: + cardinality: one + source_path: id + sourceType: + cardinality: one + source_path: type + version: + cardinality: one + relationship: __self + routing_value_source: id + script_id: update_index_data_1fdfaf1c9261c96019decc89b515bd9a + type: InspectionNote + InspectionNoteAggregatedValues: + graphql_fields_by_name: + created_at: + resolver: + name: object_with_lookahead + id: + resolver: + name: object_with_lookahead + note: + resolver: + name: object_with_lookahead + widget_inspection_guid: + resolver: + name: object_with_lookahead + InspectionNoteAggregation: + elasticgraph_category: indexed_aggregation + graphql_fields_by_name: + aggregated_values: + resolver: + name: object_without_lookahead + count: + resolver: + name: object_without_lookahead + grouped_by: + resolver: + name: object_without_lookahead + source_type: InspectionNote + InspectionNoteAggregationConnection: + elasticgraph_category: relay_connection + graphql_fields_by_name: + edges: + resolver: + name: object_without_lookahead + nodes: + resolver: + name: object_without_lookahead + page_info: + resolver: + name: object_without_lookahead + InspectionNoteAggregationEdge: + elasticgraph_category: relay_edge + graphql_fields_by_name: + cursor: + resolver: + name: object_without_lookahead + node: + resolver: + name: object_without_lookahead + InspectionNoteConnection: + elasticgraph_category: relay_connection + graphql_fields_by_name: + edges: + resolver: + name: object_without_lookahead + nodes: + resolver: + name: object_without_lookahead + page_info: + resolver: + name: object_without_lookahead + total_edge_count: + resolver: + name: object_without_lookahead + InspectionNoteEdge: + elasticgraph_category: relay_edge + graphql_fields_by_name: + all_highlights: + resolver: + name: object_without_lookahead + cursor: + resolver: + name: object_without_lookahead + highlights: + resolver: + name: object_without_lookahead + node: + resolver: + name: object_without_lookahead + InspectionNoteGroupedBy: + graphql_fields_by_name: + created_at: + resolver: + name: object_with_lookahead + note: + resolver: + name: object_with_lookahead + widget_inspection_guid: + resolver: + name: object_with_lookahead + InspectionNoteHighlights: + graphql_fields_by_name: + id: + resolver: + name: get_record_field_value + note: + resolver: + name: get_record_field_value + widget_inspection_guid: + resolver: + name: get_record_field_value + InspectionSummary: + graphql_fields_by_name: + created_at: + resolver: + name: get_record_field_value + id: + resolver: + name: get_record_field_value + summary: + resolver: + name: get_record_field_value + widget_inspection_guid: + resolver: + name: get_record_field_value + index_definition_names: + - inspection_summaries + update_targets: + - data_params: + created_at: + cardinality: one + summary: + cardinality: one + widget_inspection_guid: + cardinality: one + id_source: id + metadata_params: + relationship: + value: __self + sourceId: + cardinality: one + source_path: id + sourceType: + cardinality: one + source_path: type + version: + cardinality: one + relationship: __self + routing_value_source: id + script_id: update_index_data_1fdfaf1c9261c96019decc89b515bd9a + type: InspectionSummary + InspectionSummaryAggregatedValues: + graphql_fields_by_name: + created_at: + resolver: + name: object_with_lookahead + id: + resolver: + name: object_with_lookahead + summary: + resolver: + name: object_with_lookahead + widget_inspection_guid: + resolver: + name: object_with_lookahead + InspectionSummaryAggregation: + elasticgraph_category: indexed_aggregation + graphql_fields_by_name: + aggregated_values: + resolver: + name: object_without_lookahead + count: + resolver: + name: object_without_lookahead + grouped_by: + resolver: + name: object_without_lookahead + source_type: InspectionSummary + InspectionSummaryAggregationConnection: + elasticgraph_category: relay_connection + graphql_fields_by_name: + edges: + resolver: + name: object_without_lookahead + nodes: + resolver: + name: object_without_lookahead + page_info: + resolver: + name: object_without_lookahead + InspectionSummaryAggregationEdge: + elasticgraph_category: relay_edge + graphql_fields_by_name: + cursor: + resolver: + name: object_without_lookahead + node: + resolver: + name: object_without_lookahead + InspectionSummaryConnection: + elasticgraph_category: relay_connection + graphql_fields_by_name: + edges: + resolver: + name: object_without_lookahead + nodes: + resolver: + name: object_without_lookahead + page_info: + resolver: + name: object_without_lookahead + total_edge_count: + resolver: + name: object_without_lookahead + InspectionSummaryEdge: + elasticgraph_category: relay_edge + graphql_fields_by_name: + all_highlights: + resolver: + name: object_without_lookahead + cursor: + resolver: + name: object_without_lookahead + highlights: + resolver: + name: object_without_lookahead + node: + resolver: + name: object_without_lookahead + InspectionSummaryGroupedBy: + graphql_fields_by_name: + created_at: + resolver: + name: object_with_lookahead + summary: + resolver: + name: object_with_lookahead + widget_inspection_guid: + resolver: + name: object_with_lookahead + InspectionSummaryHighlights: + graphql_fields_by_name: + id: + resolver: + name: get_record_field_value + summary: + resolver: + name: get_record_field_value + widget_inspection_guid: + resolver: + name: get_record_field_value IntAggregatedValues: elasticgraph_category: scalar_aggregated_values graphql_fields_by_name: @@ -4339,6 +4755,7 @@ object_types_by_name: relation: direction: in foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships ceo: @@ -4354,12 +4771,14 @@ object_types_by_name: relation: direction: in foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships manufactured_parts: relation: direction: in foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships name: @@ -4497,12 +4916,14 @@ object_types_by_name: relation: direction: in foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships components: relation: direction: in foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships created_at: @@ -4515,6 +4936,7 @@ object_types_by_name: relation: direction: out foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships material: @@ -4694,6 +5116,7 @@ object_types_by_name: relation: direction: in foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships amount_cents: @@ -4713,12 +5136,14 @@ object_types_by_name: relation: direction: out foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships components: relation: direction: out foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships cost: @@ -4764,6 +5189,7 @@ object_types_by_name: - 100 direction: in foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships fees: @@ -4772,6 +5198,9 @@ object_types_by_name: id: resolver: name: get_record_field_value + inspection: + resolver: + name: get_record_field_value internal_details: resolver: name: get_record_field_value @@ -4791,18 +5220,21 @@ object_types_by_name: relation: direction: in foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships manufactured_parts: relation: direction: in foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships manufacturer: relation: direction: out foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships material: @@ -4827,12 +5259,14 @@ object_types_by_name: relation: direction: out foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships parts: relation: direction: out foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships position: @@ -4868,12 +5302,14 @@ object_types_by_name: relation: direction: in foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships widget_aggregations: relation: direction: in foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships widget_cost: @@ -4896,6 +5332,7 @@ object_types_by_name: relation: direction: in foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships workspace_id: @@ -4957,6 +5394,9 @@ object_types_by_name: id: resolver: name: object_with_lookahead + inspection: + resolver: + name: object_with_lookahead internal_details: resolver: name: object_with_lookahead @@ -5165,6 +5605,9 @@ object_types_by_name: fees: resolver: name: object_with_lookahead + inspection: + resolver: + name: object_with_lookahead internal_details: resolver: name: object_with_lookahead @@ -5276,6 +5719,9 @@ object_types_by_name: id: resolver: name: get_record_field_value + inspection: + resolver: + name: get_record_field_value internal_highlightable_details: resolver: name: get_record_field_value @@ -5533,12 +5979,14 @@ object_types_by_name: relation: direction: in foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships components: relation: direction: in foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships created_at: @@ -5551,6 +5999,7 @@ object_types_by_name: relation: direction: out foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships material: @@ -6022,6 +6471,18 @@ object_types_by_name: electrical_parts: resolver: name: indexed_type_root_fields + inspection_note_aggregations: + resolver: + name: indexed_type_root_fields + inspection_notes: + resolver: + name: indexed_type_root_fields + inspection_summaries: + resolver: + name: indexed_type_root_fields + inspection_summary_aggregations: + resolver: + name: indexed_type_root_fields inventor_aggregations: resolver: name: indexed_type_root_fields @@ -6258,12 +6719,14 @@ object_types_by_name: foreign_key_nested_paths: - current_players_nested - current_players_nested.affiliations.sponsorships_nested + referenced_field_name: id resolver: name: nested_relationships affiliated_team_from_object_aggregations: relation: direction: in foreign_key: current_players_object.affiliations.sponsorships_object.sponsor_id + referenced_field_name: id resolver: name: nested_relationships affiliated_teams_from_nested: @@ -6273,12 +6736,14 @@ object_types_by_name: foreign_key_nested_paths: - current_players_nested - current_players_nested.affiliations.sponsorships_nested + referenced_field_name: id resolver: name: nested_relationships affiliated_teams_from_object: relation: direction: in foreign_key: current_players_object.affiliations.sponsorships_object.sponsor_id + referenced_field_name: id resolver: name: nested_relationships id: @@ -7596,12 +8061,14 @@ object_types_by_name: relation: direction: out foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships components: relation: direction: out foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships cost: @@ -7644,6 +8111,9 @@ object_types_by_name: id: resolver: name: get_record_field_value + inspection: + resolver: + name: get_record_field_value internal_details: resolver: name: get_record_field_value @@ -7768,6 +8238,8 @@ object_types_by_name: cardinality: one fees: cardinality: one + inspection: + cardinality: one internal_details: cardinality: one internal_highlightable_details: @@ -7899,6 +8371,9 @@ object_types_by_name: id: resolver: name: object_with_lookahead + inspection: + resolver: + name: object_with_lookahead internal_details: resolver: name: object_with_lookahead @@ -8333,6 +8808,9 @@ object_types_by_name: fees: resolver: name: object_with_lookahead + inspection: + resolver: + name: object_with_lookahead internal_details: resolver: name: object_with_lookahead @@ -8419,6 +8897,9 @@ object_types_by_name: id: resolver: name: get_record_field_value + inspection: + resolver: + name: get_record_field_value internal_highlightable_details: resolver: name: get_record_field_value @@ -8461,6 +8942,47 @@ object_types_by_name: workspace_name: resolver: name: get_record_field_value + WidgetInspection: + graphql_fields_by_name: + guid: + resolver: + name: get_record_field_value + inspection_note_aggregations: + relation: + direction: in + foreign_key: widget_inspection_guid + referenced_field_name: guid + resolver: + name: nested_relationships + inspection_notes: + relation: + direction: in + foreign_key: widget_inspection_guid + referenced_field_name: guid + resolver: + name: nested_relationships + inspection_summary: + relation: + direction: in + foreign_key: widget_inspection_guid + referenced_field_name: guid + resolver: + name: nested_relationships + WidgetInspectionAggregatedValues: + graphql_fields_by_name: + guid: + resolver: + name: object_with_lookahead + WidgetInspectionGroupedBy: + graphql_fields_by_name: + guid: + resolver: + name: object_with_lookahead + WidgetInspectionHighlights: + graphql_fields_by_name: + guid: + resolver: + name: get_record_field_value WidgetInternalDetailsAggregatedValues: graphql_fields_by_name: name: @@ -8577,12 +9099,14 @@ object_types_by_name: relation: direction: out foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships components: relation: direction: out foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships cost: @@ -8631,6 +9155,9 @@ object_types_by_name: id: resolver: name: get_record_field_value + inspection: + resolver: + name: get_record_field_value internal_details: resolver: name: get_record_field_value @@ -8650,6 +9177,7 @@ object_types_by_name: relation: direction: out foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships metadata: @@ -8758,6 +9286,9 @@ object_types_by_name: id: resolver: name: object_with_lookahead + inspection: + resolver: + name: object_with_lookahead internal_details: resolver: name: object_with_lookahead @@ -8945,6 +9476,9 @@ object_types_by_name: full_address: resolver: name: object_with_lookahead + inspection: + resolver: + name: object_with_lookahead internal_details: resolver: name: object_with_lookahead @@ -9037,6 +9571,9 @@ object_types_by_name: id: resolver: name: get_record_field_value + inspection: + resolver: + name: get_record_field_value internal_highlightable_details: resolver: name: get_record_field_value diff --git a/config/schema/artifacts/schema.graphql b/config/schema/artifacts/schema.graphql index 3c6220fba..a9daf348e 100644 --- a/config/schema/artifacts/schema.graphql +++ b/config/schema/artifacts/schema.graphql @@ -3574,6 +3574,610 @@ input IDListFilterInput { not: IDListFilterInput } +type InspectionNote { + created_at: DateTime! + id: ID! + note: String + widget_inspection_guid: ID! +} + +""" +Type used to perform aggregation computations on `InspectionNote` fields. +""" +type InspectionNoteAggregatedValues { + """ + Computed aggregate values for the `created_at` field. + """ + created_at: DateTimeAggregatedValues + + """ + Computed aggregate values for the `id` field. + """ + id: NonNumericAggregatedValues + + """ + Computed aggregate values for the `note` field. + """ + note: NonNumericAggregatedValues + + """ + Computed aggregate values for the `widget_inspection_guid` field. + """ + widget_inspection_guid: NonNumericAggregatedValues +} + +""" +Return type representing a bucket of `InspectionNote` documents for an aggregations query. +""" +type InspectionNoteAggregation { + """ + Provides computed aggregated values over all `InspectionNote` documents in an aggregation bucket. + """ + aggregated_values: InspectionNoteAggregatedValues + + """ + The count of `InspectionNote` documents in an aggregation bucket. + """ + count: JsonSafeLong! + + """ + Used to specify the `InspectionNote` fields to group by. The returned values identify each aggregation bucket. + """ + grouped_by: InspectionNoteGroupedBy +} + +""" +Represents a paginated collection of `InspectionNoteAggregation` results. + +See the [Relay GraphQL Cursor Connections +Specification](https://relay.dev/graphql/connections.htm#sec-Connection-Types) for more info. +""" +type InspectionNoteAggregationConnection { + """ + Wraps a specific `InspectionNoteAggregation` to pair it with its pagination cursor. + """ + edges: [InspectionNoteAggregationEdge!]! + + """ + The list of `InspectionNoteAggregation` results. + """ + nodes: [InspectionNoteAggregation!]! + + """ + Provides pagination-related information. + """ + page_info: PageInfo! +} + +""" +Represents a specific `InspectionNoteAggregation` in the context of a `InspectionNoteAggregationConnection`, +providing access to both the `InspectionNoteAggregation` and query-specific information such as the pagination `Cursor`. + +See the [Relay GraphQL Cursor Connections +Specification](https://relay.dev/graphql/connections.htm#sec-Edge-Types) for more info. +""" +type InspectionNoteAggregationEdge { + """ + The `Cursor` of this `InspectionNoteAggregation`. This can be passed in the next query as + a `before` or `after` argument to continue paginating from this `InspectionNoteAggregation`. + """ + cursor: Cursor + + """ + The `InspectionNoteAggregation` of this edge. + """ + node: InspectionNoteAggregation +} + +""" +Represents a paginated collection of `InspectionNote` results. + +See the [Relay GraphQL Cursor Connections +Specification](https://relay.dev/graphql/connections.htm#sec-Connection-Types) for more info. +""" +type InspectionNoteConnection { + """ + Wraps a specific `InspectionNote` to pair it with its pagination cursor. + """ + edges: [InspectionNoteEdge!]! + + """ + The list of `InspectionNote` results. + """ + nodes: [InspectionNote!]! + + """ + Provides pagination-related information. + """ + page_info: PageInfo! + + """ + The total number of edges available in this connection to paginate over. + """ + total_edge_count: JsonSafeLong! +} + +""" +Represents a specific `InspectionNote` in the context of a `InspectionNoteConnection`, +providing access to both the `InspectionNote` and query-specific information such as the pagination `Cursor`. + +See the [Relay GraphQL Cursor Connections +Specification](https://relay.dev/graphql/connections.htm#sec-Edge-Types) for more info. +""" +type InspectionNoteEdge { + """ + All search highlights for this `InspectionNote`, indicating where in the indexed document the query matched. + """ + all_highlights: [SearchHighlight!]! + + """ + The `Cursor` of this `InspectionNote`. This can be passed in the next query as + a `before` or `after` argument to continue paginating from this `InspectionNote`. + """ + cursor: Cursor + + """ + Specific search highlights for this `InspectionNote`, providing matching snippets for the requested fields. + """ + highlights: InspectionNoteHighlights + + """ + The `InspectionNote` of this edge. + """ + node: InspectionNote +} + +""" +Input type used to specify filters on `InspectionNote` fields. + +Will match all documents if passed as an empty object (or as `null`). +""" +input InspectionNoteFilterInput { + """ + Matches records where all of the provided sub-filters evaluate to true. This works just like an AND operator in SQL. + + Note: multiple filters are automatically ANDed together. This is only needed when you have multiple filters that can't + be provided on a single `InspectionNoteFilterInput` input because of + collisions between key names. For example, if you want to AND multiple + OR'd sub-filters (the equivalent of (A OR B) AND (C OR D)), you could do all_of: [{any_of: [...]}, {any_of: [...]}]. + + When `null` or an empty list is passed, matches all documents. + """ + all_of: [InspectionNoteFilterInput!] + + """ + Matches records where any of the provided sub-filters evaluate to true. + This works just like an OR operator in SQL. + + When `null` is passed, matches all documents. + When an empty list is passed, this part of the filter matches no documents. + """ + any_of: [InspectionNoteFilterInput!] + + """ + Used to filter on the `created_at` field. + + When `null` or an empty object is passed, matches all documents. + """ + created_at: DateTimeFilterInput + + """ + Used to filter on the `id` field. + + When `null` or an empty object is passed, matches all documents. + """ + id: IDFilterInput + + """ + Matches records where the provided sub-filter evaluates to false. + This works just like a NOT operator in SQL. + + When `null` or an empty object is passed, matches no documents. + """ + not: InspectionNoteFilterInput + + """ + Used to filter on the `note` field. + + When `null` or an empty object is passed, matches all documents. + """ + note: StringFilterInput + + """ + Used to filter on the `widget_inspection_guid` field. + + When `null` or an empty object is passed, matches all documents. + """ + widget_inspection_guid: IDFilterInput +} + +""" +Type used to specify the `InspectionNote` fields to group by for aggregations. +""" +type InspectionNoteGroupedBy { + """ + Offers the different grouping options for the `created_at` value within this group. + """ + created_at: DateTimeGroupedBy + + """ + The `note` field value for this group. + """ + note: String + + """ + The `widget_inspection_guid` field value for this group. + """ + widget_inspection_guid: ID +} + +""" +Type used to request desired `InspectionNote` search highlight fields. +""" +type InspectionNoteHighlights { + """ + Search highlights for the `id`, providing snippets of the matching text. + """ + id: [String!]! + + """ + Search highlights for the `note`, providing snippets of the matching text. + """ + note: [String!]! + + """ + Search highlights for the `widget_inspection_guid`, providing snippets of the matching text. + """ + widget_inspection_guid: [String!]! +} + +""" +Enumerates the ways `InspectionNote`s can be sorted. +""" +enum InspectionNoteSortOrderInput { + """ + Sorts ascending by the `created_at` field. + """ + created_at_ASC + + """ + Sorts descending by the `created_at` field. + """ + created_at_DESC + + """ + Sorts ascending by the `id` field. + """ + id_ASC + + """ + Sorts descending by the `id` field. + """ + id_DESC + + """ + Sorts ascending by the `note` field. + """ + note_ASC + + """ + Sorts descending by the `note` field. + """ + note_DESC + + """ + Sorts ascending by the `widget_inspection_guid` field. + """ + widget_inspection_guid_ASC + + """ + Sorts descending by the `widget_inspection_guid` field. + """ + widget_inspection_guid_DESC +} + +type InspectionSummary { + created_at: DateTime! + id: ID! + summary: String + widget_inspection_guid: ID! +} + +""" +Type used to perform aggregation computations on `InspectionSummary` fields. +""" +type InspectionSummaryAggregatedValues { + """ + Computed aggregate values for the `created_at` field. + """ + created_at: DateTimeAggregatedValues + + """ + Computed aggregate values for the `id` field. + """ + id: NonNumericAggregatedValues + + """ + Computed aggregate values for the `summary` field. + """ + summary: NonNumericAggregatedValues + + """ + Computed aggregate values for the `widget_inspection_guid` field. + """ + widget_inspection_guid: NonNumericAggregatedValues +} + +""" +Return type representing a bucket of `InspectionSummary` documents for an aggregations query. +""" +type InspectionSummaryAggregation { + """ + Provides computed aggregated values over all `InspectionSummary` documents in an aggregation bucket. + """ + aggregated_values: InspectionSummaryAggregatedValues + + """ + The count of `InspectionSummary` documents in an aggregation bucket. + """ + count: JsonSafeLong! + + """ + Used to specify the `InspectionSummary` fields to group by. The returned values identify each aggregation bucket. + """ + grouped_by: InspectionSummaryGroupedBy +} + +""" +Represents a paginated collection of `InspectionSummaryAggregation` results. + +See the [Relay GraphQL Cursor Connections +Specification](https://relay.dev/graphql/connections.htm#sec-Connection-Types) for more info. +""" +type InspectionSummaryAggregationConnection { + """ + Wraps a specific `InspectionSummaryAggregation` to pair it with its pagination cursor. + """ + edges: [InspectionSummaryAggregationEdge!]! + + """ + The list of `InspectionSummaryAggregation` results. + """ + nodes: [InspectionSummaryAggregation!]! + + """ + Provides pagination-related information. + """ + page_info: PageInfo! +} + +""" +Represents a specific `InspectionSummaryAggregation` in the context of a `InspectionSummaryAggregationConnection`, +providing access to both the `InspectionSummaryAggregation` and query-specific information such as the pagination `Cursor`. + +See the [Relay GraphQL Cursor Connections +Specification](https://relay.dev/graphql/connections.htm#sec-Edge-Types) for more info. +""" +type InspectionSummaryAggregationEdge { + """ + The `Cursor` of this `InspectionSummaryAggregation`. This can be passed in the next query as + a `before` or `after` argument to continue paginating from this `InspectionSummaryAggregation`. + """ + cursor: Cursor + + """ + The `InspectionSummaryAggregation` of this edge. + """ + node: InspectionSummaryAggregation +} + +""" +Represents a paginated collection of `InspectionSummary` results. + +See the [Relay GraphQL Cursor Connections +Specification](https://relay.dev/graphql/connections.htm#sec-Connection-Types) for more info. +""" +type InspectionSummaryConnection { + """ + Wraps a specific `InspectionSummary` to pair it with its pagination cursor. + """ + edges: [InspectionSummaryEdge!]! + + """ + The list of `InspectionSummary` results. + """ + nodes: [InspectionSummary!]! + + """ + Provides pagination-related information. + """ + page_info: PageInfo! + + """ + The total number of edges available in this connection to paginate over. + """ + total_edge_count: JsonSafeLong! +} + +""" +Represents a specific `InspectionSummary` in the context of a `InspectionSummaryConnection`, +providing access to both the `InspectionSummary` and query-specific information such as the pagination `Cursor`. + +See the [Relay GraphQL Cursor Connections +Specification](https://relay.dev/graphql/connections.htm#sec-Edge-Types) for more info. +""" +type InspectionSummaryEdge { + """ + All search highlights for this `InspectionSummary`, indicating where in the indexed document the query matched. + """ + all_highlights: [SearchHighlight!]! + + """ + The `Cursor` of this `InspectionSummary`. This can be passed in the next query as + a `before` or `after` argument to continue paginating from this `InspectionSummary`. + """ + cursor: Cursor + + """ + Specific search highlights for this `InspectionSummary`, providing matching snippets for the requested fields. + """ + highlights: InspectionSummaryHighlights + + """ + The `InspectionSummary` of this edge. + """ + node: InspectionSummary +} + +""" +Input type used to specify filters on `InspectionSummary` fields. + +Will match all documents if passed as an empty object (or as `null`). +""" +input InspectionSummaryFilterInput { + """ + Matches records where all of the provided sub-filters evaluate to true. This works just like an AND operator in SQL. + + Note: multiple filters are automatically ANDed together. This is only needed when you have multiple filters that can't + be provided on a single `InspectionSummaryFilterInput` input because of + collisions between key names. For example, if you want to AND multiple + OR'd sub-filters (the equivalent of (A OR B) AND (C OR D)), you could do all_of: [{any_of: [...]}, {any_of: [...]}]. + + When `null` or an empty list is passed, matches all documents. + """ + all_of: [InspectionSummaryFilterInput!] + + """ + Matches records where any of the provided sub-filters evaluate to true. + This works just like an OR operator in SQL. + + When `null` is passed, matches all documents. + When an empty list is passed, this part of the filter matches no documents. + """ + any_of: [InspectionSummaryFilterInput!] + + """ + Used to filter on the `created_at` field. + + When `null` or an empty object is passed, matches all documents. + """ + created_at: DateTimeFilterInput + + """ + Used to filter on the `id` field. + + When `null` or an empty object is passed, matches all documents. + """ + id: IDFilterInput + + """ + Matches records where the provided sub-filter evaluates to false. + This works just like a NOT operator in SQL. + + When `null` or an empty object is passed, matches no documents. + """ + not: InspectionSummaryFilterInput + + """ + Used to filter on the `summary` field. + + When `null` or an empty object is passed, matches all documents. + """ + summary: StringFilterInput + + """ + Used to filter on the `widget_inspection_guid` field. + + When `null` or an empty object is passed, matches all documents. + """ + widget_inspection_guid: IDFilterInput +} + +""" +Type used to specify the `InspectionSummary` fields to group by for aggregations. +""" +type InspectionSummaryGroupedBy { + """ + Offers the different grouping options for the `created_at` value within this group. + """ + created_at: DateTimeGroupedBy + + """ + The `summary` field value for this group. + """ + summary: String + + """ + The `widget_inspection_guid` field value for this group. + """ + widget_inspection_guid: ID +} + +""" +Type used to request desired `InspectionSummary` search highlight fields. +""" +type InspectionSummaryHighlights { + """ + Search highlights for the `id`, providing snippets of the matching text. + """ + id: [String!]! + + """ + Search highlights for the `summary`, providing snippets of the matching text. + """ + summary: [String!]! + + """ + Search highlights for the `widget_inspection_guid`, providing snippets of the matching text. + """ + widget_inspection_guid: [String!]! +} + +""" +Enumerates the ways `InspectionSummary`s can be sorted. +""" +enum InspectionSummarySortOrderInput { + """ + Sorts ascending by the `created_at` field. + """ + created_at_ASC + + """ + Sorts descending by the `created_at` field. + """ + created_at_DESC + + """ + Sorts ascending by the `id` field. + """ + id_ASC + + """ + Sorts descending by the `id` field. + """ + id_DESC + + """ + Sorts ascending by the `summary` field. + """ + summary_ASC + + """ + Sorts descending by the `summary` field. + """ + summary_DESC + + """ + Sorts ascending by the `widget_inspection_guid` field. + """ + widget_inspection_guid_ASC + + """ + Sorts descending by the `widget_inspection_guid` field. + """ + widget_inspection_guid_DESC +} + """ A return type used from aggregations to provided aggregated values over `Int` fields. """ @@ -6013,6 +6617,11 @@ type NamedEntityAggregatedValues { """ id: NonNumericAggregatedValues + """ + Computed aggregate values for the `inspection` field. + """ + inspection: WidgetInspectionAggregatedValues + """ Computed aggregate values for the `internal_details` field. """ @@ -6419,6 +7028,13 @@ input NamedEntityFilterInput { """ id: IDFilterInput + """ + Used to filter on the `inspection` field. + + When `null` or an empty object is passed, matches all documents. + """ + inspection: WidgetInspectionFilterInput + """ Used to filter on the `internal_details` field. @@ -6698,6 +7314,11 @@ type NamedEntityGroupedBy { """ fees: MoneyGroupedBy + """ + The `inspection` field value for this group. + """ + inspection: WidgetInspectionGroupedBy + """ The `internal_details` field value for this group. """ @@ -6892,6 +7513,11 @@ type NamedEntityHighlights { """ id: [String!]! + """ + Search highlights for the `inspection`, providing snippets of the matching text. + """ + inspection: WidgetInspectionHighlights + """ Search highlights for the `internal_highlightable_details`, providing snippets of the matching text. """ @@ -7162,6 +7788,16 @@ enum NamedEntitySortOrderInput { """ id_DESC + """ + Sorts ascending by the `inspection.guid` field. + """ + inspection_guid_ASC + + """ + Sorts descending by the `inspection.guid` field. + """ + inspection_guid_DESC + """ Sorts ascending by the `internal_details.name` field. """ @@ -9364,14 +10000,220 @@ type Query { Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. """ last: Int - ): ComponentAggregationConnection + ): ComponentAggregationConnection + + """ + Fetches `Component`s based on the provided arguments. + """ + components( + """ + Used to forward-paginate through the `components`. When provided, the next page after the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + after: Cursor + + """ + Used to backward-paginate through the `components`. When provided, the previous page before the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + before: Cursor + + """ + Used to filter the returned `components` based on the provided criteria. + """ + filter: ComponentFilterInput + + """ + Used in conjunction with the `after` argument to forward-paginate through the `components`. + When provided, limits the number of returned results to the first `n` after the provided + `after` cursor (or from the start of the `components`, if no `after` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + first: Int + + """ + Used in conjunction with the `before` argument to backward-paginate through the `components`. + When provided, limits the number of returned results to the last `n` before the provided + `before` cursor (or from the end of the `components`, if no `before` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + last: Int + + """ + Used to specify how the returned `components` should be sorted. + """ + order_by: [ComponentSortOrderInput!] + ): ComponentConnection + + """ + Aggregations over the `distribution_channels` data: + + > Fetches `DistributionChannel`s based on the provided arguments. + """ + distribution_channel_aggregations( + """ + Used to forward-paginate through the `distribution_channel_aggregations`. When provided, the next page after the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + after: Cursor + + """ + Used to backward-paginate through the `distribution_channel_aggregations`. When provided, the previous page before the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + before: Cursor + + """ + Used to filter the `DistributionChannel` documents that get aggregated over based on the provided criteria. + """ + filter: DistributionChannelFilterInput + + """ + Used in conjunction with the `after` argument to forward-paginate through the `distribution_channel_aggregations`. + When provided, limits the number of returned results to the first `n` after the provided + `after` cursor (or from the start of the `distribution_channel_aggregations`, if no `after` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + first: Int + + """ + Used in conjunction with the `before` argument to backward-paginate through the `distribution_channel_aggregations`. + When provided, limits the number of returned results to the last `n` before the provided + `before` cursor (or from the end of the `distribution_channel_aggregations`, if no `before` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + last: Int + ): DistributionChannelAggregationConnection + + """ + Fetches `DistributionChannel`s based on the provided arguments. + """ + distribution_channels( + """ + Used to forward-paginate through the `distribution_channels`. When provided, the next page after the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + after: Cursor + + """ + Used to backward-paginate through the `distribution_channels`. When provided, the previous page before the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + before: Cursor + + """ + Used to filter the returned `distribution_channels` based on the provided criteria. + """ + filter: DistributionChannelFilterInput + + """ + Used in conjunction with the `after` argument to forward-paginate through the `distribution_channels`. + When provided, limits the number of returned results to the first `n` after the provided + `after` cursor (or from the start of the `distribution_channels`, if no `after` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + first: Int + + """ + Used in conjunction with the `before` argument to backward-paginate through the `distribution_channels`. + When provided, limits the number of returned results to the last `n` before the provided + `before` cursor (or from the end of the `distribution_channels`, if no `before` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + last: Int + + """ + Used to specify how the returned `distribution_channels` should be sorted. + """ + order_by: [DistributionChannelSortOrderInput!] + ): DistributionChannelConnection + + """ + Aggregations over the `electrical_parts` data: + + > Fetches `ElectricalPart`s based on the provided arguments. + """ + electrical_part_aggregations( + """ + Used to forward-paginate through the `electrical_part_aggregations`. When provided, the next page after the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + after: Cursor + + """ + Used to backward-paginate through the `electrical_part_aggregations`. When provided, the previous page before the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + before: Cursor + + """ + Used to filter the `ElectricalPart` documents that get aggregated over based on the provided criteria. + """ + filter: ElectricalPartFilterInput + + """ + Used in conjunction with the `after` argument to forward-paginate through the `electrical_part_aggregations`. + When provided, limits the number of returned results to the first `n` after the provided + `after` cursor (or from the start of the `electrical_part_aggregations`, if no `after` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + first: Int + + """ + Used in conjunction with the `before` argument to backward-paginate through the `electrical_part_aggregations`. + When provided, limits the number of returned results to the last `n` before the provided + `before` cursor (or from the end of the `electrical_part_aggregations`, if no `before` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + last: Int + ): ElectricalPartAggregationConnection """ - Fetches `Component`s based on the provided arguments. + Fetches `ElectricalPart`s based on the provided arguments. """ - components( + electrical_parts( """ - Used to forward-paginate through the `components`. When provided, the next page after the + Used to forward-paginate through the `electrical_parts`. When provided, the next page after the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9380,7 +10222,7 @@ type Query { after: Cursor """ - Used to backward-paginate through the `components`. When provided, the previous page before the + Used to backward-paginate through the `electrical_parts`. When provided, the previous page before the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9389,14 +10231,14 @@ type Query { before: Cursor """ - Used to filter the returned `components` based on the provided criteria. + Used to filter the returned `electrical_parts` based on the provided criteria. """ - filter: ComponentFilterInput + filter: ElectricalPartFilterInput """ - Used in conjunction with the `after` argument to forward-paginate through the `components`. + Used in conjunction with the `after` argument to forward-paginate through the `electrical_parts`. When provided, limits the number of returned results to the first `n` after the provided - `after` cursor (or from the start of the `components`, if no `after` cursor is provided). + `after` cursor (or from the start of the `electrical_parts`, if no `after` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. @@ -9404,9 +10246,9 @@ type Query { first: Int """ - Used in conjunction with the `before` argument to backward-paginate through the `components`. + Used in conjunction with the `before` argument to backward-paginate through the `electrical_parts`. When provided, limits the number of returned results to the last `n` before the provided - `before` cursor (or from the end of the `components`, if no `before` cursor is provided). + `before` cursor (or from the end of the `electrical_parts`, if no `before` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. @@ -9414,19 +10256,19 @@ type Query { last: Int """ - Used to specify how the returned `components` should be sorted. + Used to specify how the returned `electrical_parts` should be sorted. """ - order_by: [ComponentSortOrderInput!] - ): ComponentConnection + order_by: [ElectricalPartSortOrderInput!] + ): ElectricalPartConnection """ - Aggregations over the `distribution_channels` data: + Aggregations over the `inspection_notes` data: - > Fetches `DistributionChannel`s based on the provided arguments. + > Fetches `InspectionNote`s based on the provided arguments. """ - distribution_channel_aggregations( + inspection_note_aggregations( """ - Used to forward-paginate through the `distribution_channel_aggregations`. When provided, the next page after the + Used to forward-paginate through the `inspection_note_aggregations`. When provided, the next page after the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9435,7 +10277,7 @@ type Query { after: Cursor """ - Used to backward-paginate through the `distribution_channel_aggregations`. When provided, the previous page before the + Used to backward-paginate through the `inspection_note_aggregations`. When provided, the previous page before the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9444,14 +10286,14 @@ type Query { before: Cursor """ - Used to filter the `DistributionChannel` documents that get aggregated over based on the provided criteria. + Used to filter the `InspectionNote` documents that get aggregated over based on the provided criteria. """ - filter: DistributionChannelFilterInput + filter: InspectionNoteFilterInput """ - Used in conjunction with the `after` argument to forward-paginate through the `distribution_channel_aggregations`. + Used in conjunction with the `after` argument to forward-paginate through the `inspection_note_aggregations`. When provided, limits the number of returned results to the first `n` after the provided - `after` cursor (or from the start of the `distribution_channel_aggregations`, if no `after` cursor is provided). + `after` cursor (or from the start of the `inspection_note_aggregations`, if no `after` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. @@ -9459,22 +10301,22 @@ type Query { first: Int """ - Used in conjunction with the `before` argument to backward-paginate through the `distribution_channel_aggregations`. + Used in conjunction with the `before` argument to backward-paginate through the `inspection_note_aggregations`. When provided, limits the number of returned results to the last `n` before the provided - `before` cursor (or from the end of the `distribution_channel_aggregations`, if no `before` cursor is provided). + `before` cursor (or from the end of the `inspection_note_aggregations`, if no `before` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. """ last: Int - ): DistributionChannelAggregationConnection + ): InspectionNoteAggregationConnection """ - Fetches `DistributionChannel`s based on the provided arguments. + Fetches `InspectionNote`s based on the provided arguments. """ - distribution_channels( + inspection_notes( """ - Used to forward-paginate through the `distribution_channels`. When provided, the next page after the + Used to forward-paginate through the `inspection_notes`. When provided, the next page after the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9483,7 +10325,7 @@ type Query { after: Cursor """ - Used to backward-paginate through the `distribution_channels`. When provided, the previous page before the + Used to backward-paginate through the `inspection_notes`. When provided, the previous page before the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9492,14 +10334,14 @@ type Query { before: Cursor """ - Used to filter the returned `distribution_channels` based on the provided criteria. + Used to filter the returned `inspection_notes` based on the provided criteria. """ - filter: DistributionChannelFilterInput + filter: InspectionNoteFilterInput """ - Used in conjunction with the `after` argument to forward-paginate through the `distribution_channels`. + Used in conjunction with the `after` argument to forward-paginate through the `inspection_notes`. When provided, limits the number of returned results to the first `n` after the provided - `after` cursor (or from the start of the `distribution_channels`, if no `after` cursor is provided). + `after` cursor (or from the start of the `inspection_notes`, if no `after` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. @@ -9507,9 +10349,9 @@ type Query { first: Int """ - Used in conjunction with the `before` argument to backward-paginate through the `distribution_channels`. + Used in conjunction with the `before` argument to backward-paginate through the `inspection_notes`. When provided, limits the number of returned results to the last `n` before the provided - `before` cursor (or from the end of the `distribution_channels`, if no `before` cursor is provided). + `before` cursor (or from the end of the `inspection_notes`, if no `before` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. @@ -9517,19 +10359,17 @@ type Query { last: Int """ - Used to specify how the returned `distribution_channels` should be sorted. + Used to specify how the returned `inspection_notes` should be sorted. """ - order_by: [DistributionChannelSortOrderInput!] - ): DistributionChannelConnection + order_by: [InspectionNoteSortOrderInput!] + ): InspectionNoteConnection """ - Aggregations over the `electrical_parts` data: - - > Fetches `ElectricalPart`s based on the provided arguments. + Fetches `InspectionSummary`s based on the provided arguments. """ - electrical_part_aggregations( + inspection_summaries( """ - Used to forward-paginate through the `electrical_part_aggregations`. When provided, the next page after the + Used to forward-paginate through the `inspection_summaries`. When provided, the next page after the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9538,7 +10378,7 @@ type Query { after: Cursor """ - Used to backward-paginate through the `electrical_part_aggregations`. When provided, the previous page before the + Used to backward-paginate through the `inspection_summaries`. When provided, the previous page before the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9547,14 +10387,14 @@ type Query { before: Cursor """ - Used to filter the `ElectricalPart` documents that get aggregated over based on the provided criteria. + Used to filter the returned `inspection_summaries` based on the provided criteria. """ - filter: ElectricalPartFilterInput + filter: InspectionSummaryFilterInput """ - Used in conjunction with the `after` argument to forward-paginate through the `electrical_part_aggregations`. + Used in conjunction with the `after` argument to forward-paginate through the `inspection_summaries`. When provided, limits the number of returned results to the first `n` after the provided - `after` cursor (or from the start of the `electrical_part_aggregations`, if no `after` cursor is provided). + `after` cursor (or from the start of the `inspection_summaries`, if no `after` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. @@ -9562,22 +10402,29 @@ type Query { first: Int """ - Used in conjunction with the `before` argument to backward-paginate through the `electrical_part_aggregations`. + Used in conjunction with the `before` argument to backward-paginate through the `inspection_summaries`. When provided, limits the number of returned results to the last `n` before the provided - `before` cursor (or from the end of the `electrical_part_aggregations`, if no `before` cursor is provided). + `before` cursor (or from the end of the `inspection_summaries`, if no `before` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. """ last: Int - ): ElectricalPartAggregationConnection + + """ + Used to specify how the returned `inspection_summaries` should be sorted. + """ + order_by: [InspectionSummarySortOrderInput!] + ): InspectionSummaryConnection """ - Fetches `ElectricalPart`s based on the provided arguments. + Aggregations over the `inspection_summaries` data: + + > Fetches `InspectionSummary`s based on the provided arguments. """ - electrical_parts( + inspection_summary_aggregations( """ - Used to forward-paginate through the `electrical_parts`. When provided, the next page after the + Used to forward-paginate through the `inspection_summary_aggregations`. When provided, the next page after the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9586,7 +10433,7 @@ type Query { after: Cursor """ - Used to backward-paginate through the `electrical_parts`. When provided, the previous page before the + Used to backward-paginate through the `inspection_summary_aggregations`. When provided, the previous page before the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9595,14 +10442,14 @@ type Query { before: Cursor """ - Used to filter the returned `electrical_parts` based on the provided criteria. + Used to filter the `InspectionSummary` documents that get aggregated over based on the provided criteria. """ - filter: ElectricalPartFilterInput + filter: InspectionSummaryFilterInput """ - Used in conjunction with the `after` argument to forward-paginate through the `electrical_parts`. + Used in conjunction with the `after` argument to forward-paginate through the `inspection_summary_aggregations`. When provided, limits the number of returned results to the first `n` after the provided - `after` cursor (or from the start of the `electrical_parts`, if no `after` cursor is provided). + `after` cursor (or from the start of the `inspection_summary_aggregations`, if no `after` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. @@ -9610,20 +10457,15 @@ type Query { first: Int """ - Used in conjunction with the `before` argument to backward-paginate through the `electrical_parts`. + Used in conjunction with the `before` argument to backward-paginate through the `inspection_summary_aggregations`. When provided, limits the number of returned results to the last `n` before the provided - `before` cursor (or from the end of the `electrical_parts`, if no `before` cursor is provided). + `before` cursor (or from the end of the `inspection_summary_aggregations`, if no `before` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. """ last: Int - - """ - Used to specify how the returned `electrical_parts` should be sorted. - """ - order_by: [ElectricalPartSortOrderInput!] - ): ElectricalPartConnection + ): InspectionSummaryAggregationConnection """ Aggregations over the `inventors` data: @@ -15648,6 +16490,7 @@ type Widget implements NamedEntity { description: String fees: [Money!]! id: ID! + inspection: WidgetInspection inventor: Inventor metadata: Untyped name: String @@ -15744,6 +16587,11 @@ type WidgetAggregatedValues { """ id: NonNumericAggregatedValues + """ + Computed aggregate values for the `inspection` field. + """ + inspection: WidgetInspectionAggregatedValues + """ Computed aggregate values for the `internal_details` field. """ @@ -16715,6 +17563,13 @@ input WidgetFilterInput { """ id: IDFilterInput + """ + Used to filter on the `inspection` field. + + When `null` or an empty object is passed, matches all documents. + """ + inspection: WidgetInspectionFilterInput + """ Used to filter on the `internal_details` field. @@ -16933,6 +17788,11 @@ type WidgetGroupedBy { """ fees: MoneyGroupedBy + """ + The `inspection` field value for this group. + """ + inspection: WidgetInspectionGroupedBy + """ The `internal_details` field value for this group. """ @@ -17087,6 +17947,11 @@ type WidgetHighlights { """ id: [String!]! + """ + Search highlights for the `inspection`, providing snippets of the matching text. + """ + inspection: WidgetInspectionHighlights + """ Search highlights for the `internal_highlightable_details`, providing snippets of the matching text. """ @@ -17153,6 +18018,181 @@ type WidgetHighlights { workspace_name: [String!]! } +type WidgetInspection { + guid: ID! + + """ + Aggregations over the `inspection_notes` data. + """ + inspection_note_aggregations( + """ + Used to forward-paginate through the `inspection_note_aggregations`. When provided, the next page after the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + after: Cursor + + """ + Used to backward-paginate through the `inspection_note_aggregations`. When provided, the previous page before the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + before: Cursor + + """ + Used to filter the `InspectionNote` documents that get aggregated over based on the provided criteria. + """ + filter: InspectionNoteFilterInput + + """ + Used in conjunction with the `after` argument to forward-paginate through the `inspection_note_aggregations`. + When provided, limits the number of returned results to the first `n` after the provided + `after` cursor (or from the start of the `inspection_note_aggregations`, if no `after` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + first: Int + + """ + Used in conjunction with the `before` argument to backward-paginate through the `inspection_note_aggregations`. + When provided, limits the number of returned results to the last `n` before the provided + `before` cursor (or from the end of the `inspection_note_aggregations`, if no `before` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + last: Int + ): InspectionNoteAggregationConnection + inspection_notes( + """ + Used to forward-paginate through the `inspection_notes`. When provided, the next page after the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + after: Cursor + + """ + Used to backward-paginate through the `inspection_notes`. When provided, the previous page before the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + before: Cursor + + """ + Used to filter the returned `inspection_notes` based on the provided criteria. + """ + filter: InspectionNoteFilterInput + + """ + Used in conjunction with the `after` argument to forward-paginate through the `inspection_notes`. + When provided, limits the number of returned results to the first `n` after the provided + `after` cursor (or from the start of the `inspection_notes`, if no `after` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + first: Int + + """ + Used in conjunction with the `before` argument to backward-paginate through the `inspection_notes`. + When provided, limits the number of returned results to the last `n` before the provided + `before` cursor (or from the end of the `inspection_notes`, if no `before` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + last: Int + + """ + Used to specify how the returned `inspection_notes` should be sorted. + """ + order_by: [InspectionNoteSortOrderInput!] + ): InspectionNoteConnection + inspection_summary: InspectionSummary +} + +""" +Type used to perform aggregation computations on `WidgetInspection` fields. +""" +type WidgetInspectionAggregatedValues { + """ + Computed aggregate values for the `guid` field. + """ + guid: NonNumericAggregatedValues +} + +""" +Input type used to specify filters on `WidgetInspection` fields. + +Will match all documents if passed as an empty object (or as `null`). +""" +input WidgetInspectionFilterInput { + """ + Matches records where all of the provided sub-filters evaluate to true. This works just like an AND operator in SQL. + + Note: multiple filters are automatically ANDed together. This is only needed when you have multiple filters that can't + be provided on a single `WidgetInspectionFilterInput` input because of + collisions between key names. For example, if you want to AND multiple + OR'd sub-filters (the equivalent of (A OR B) AND (C OR D)), you could do all_of: [{any_of: [...]}, {any_of: [...]}]. + + When `null` or an empty list is passed, matches all documents. + """ + all_of: [WidgetInspectionFilterInput!] + + """ + Matches records where any of the provided sub-filters evaluate to true. + This works just like an OR operator in SQL. + + When `null` is passed, matches all documents. + When an empty list is passed, this part of the filter matches no documents. + """ + any_of: [WidgetInspectionFilterInput!] + + """ + Used to filter on the `guid` field. + + When `null` or an empty object is passed, matches all documents. + """ + guid: IDFilterInput + + """ + Matches records where the provided sub-filter evaluates to false. + This works just like a NOT operator in SQL. + + When `null` or an empty object is passed, matches no documents. + """ + not: WidgetInspectionFilterInput +} + +""" +Type used to specify the `WidgetInspection` fields to group by for aggregations. +""" +type WidgetInspectionGroupedBy { + """ + The `guid` field value for this group. + """ + guid: ID +} + +""" +Type used to request desired `WidgetInspection` search highlight fields. +""" +type WidgetInspectionHighlights { + """ + Search highlights for the `guid`, providing snippets of the matching text. + """ + guid: [String!]! +} + """ Type used to perform aggregation computations on `WidgetInternalDetails` fields. """ @@ -17543,6 +18583,11 @@ type WidgetOrAddressAggregatedValues { """ id: NonNumericAggregatedValues + """ + Computed aggregate values for the `inspection` field. + """ + inspection: WidgetInspectionAggregatedValues + """ Computed aggregate values for the `internal_details` field. """ @@ -17926,6 +18971,13 @@ input WidgetOrAddressFilterInput { """ id: IDFilterInput + """ + Used to filter on the `inspection` field. + + When `null` or an empty object is passed, matches all documents. + """ + inspection: WidgetInspectionFilterInput + """ Used to filter on the `internal_details` field. @@ -18156,6 +19208,11 @@ type WidgetOrAddressGroupedBy { """ full_address: String + """ + The `inspection` field value for this group. + """ + inspection: WidgetInspectionGroupedBy + """ The `internal_details` field value for this group. """ @@ -18320,6 +19377,11 @@ type WidgetOrAddressHighlights { """ id: [String!]! + """ + Search highlights for the `inspection`, providing snippets of the matching text. + """ + inspection: WidgetInspectionHighlights + """ Search highlights for the `internal_highlightable_details`, providing snippets of the matching text. """ @@ -18540,6 +19602,16 @@ enum WidgetOrAddressSortOrderInput { """ id_DESC + """ + Sorts ascending by the `inspection.guid` field. + """ + inspection_guid_ASC + + """ + Sorts descending by the `inspection.guid` field. + """ + inspection_guid_DESC + """ Sorts ascending by the `internal_details.name` field. """ @@ -18945,6 +20017,16 @@ enum WidgetSortOrderInput { """ id_DESC + """ + Sorts ascending by the `inspection.guid` field. + """ + inspection_guid_ASC + + """ + Sorts descending by the `inspection.guid` field. + """ + inspection_guid_DESC + """ Sorts ascending by the `internal_details.name` field. """ diff --git a/config/schema/artifacts_with_apollo/data_warehouse.yaml b/config/schema/artifacts_with_apollo/data_warehouse.yaml index 6f1c02601..1112fd9f4 100644 --- a/config/schema/artifacts_with_apollo/data_warehouse.yaml +++ b/config/schema/artifacts_with_apollo/data_warehouse.yaml @@ -49,6 +49,22 @@ tables: voltage INT, manufacturer_id STRING ) + inspection_notes: + table_schema: |- + CREATE TABLE IF NOT EXISTS inspection_notes ( + id STRING, + widget_inspection_guid STRING, + note STRING, + created_at TIMESTAMP + ) + inspection_summaries: + table_schema: |- + CREATE TABLE IF NOT EXISTS inspection_summaries ( + id STRING, + widget_inspection_guid STRING, + summary STRING, + created_at TIMESTAMP + ) manufacturers: table_schema: |- CREATE TABLE IF NOT EXISTS manufacturers ( @@ -161,5 +177,6 @@ tables: amounts ARRAY, fees ARRAY>, metadata STRING, - workspace_name STRING + workspace_name STRING, + inspection STRUCT ) diff --git a/config/schema/artifacts_with_apollo/datastore_config.yaml b/config/schema/artifacts_with_apollo/datastore_config.yaml index 7fd1aebc7..b044c647f 100644 --- a/config/schema/artifacts_with_apollo/datastore_config.yaml +++ b/config/schema/artifacts_with_apollo/datastore_config.yaml @@ -1458,6 +1458,10 @@ index_templates: type: keyword workspace_name: type: keyword + inspection: + properties: + guid: + type: keyword __counts: properties: release_timestamps: @@ -1670,6 +1674,66 @@ indices: index.number_of_replicas: 1 index.number_of_shards: 1 index.max_result_window: 10000 + inspection_notes: + aliases: {} + mappings: + dynamic: strict + properties: + id: + type: keyword + widget_inspection_guid: + type: keyword + note: + type: keyword + created_at: + type: date + format: strict_date_time + __sources: + type: keyword + __versions: + type: object + dynamic: 'false' + __typename: + type: constant_keyword + value: InspectionNote + _size: + enabled: true + settings: + index.mapping.ignore_malformed: false + index.mapping.coerce: false + index.number_of_replicas: 1 + index.number_of_shards: 1 + index.max_result_window: 10000 + inspection_summaries: + aliases: {} + mappings: + dynamic: strict + properties: + id: + type: keyword + widget_inspection_guid: + type: keyword + summary: + type: keyword + created_at: + type: date + format: strict_date_time + __sources: + type: keyword + __versions: + type: object + dynamic: 'false' + __typename: + type: constant_keyword + value: InspectionSummary + _size: + enabled: true + settings: + index.mapping.ignore_malformed: false + index.mapping.coerce: false + index.number_of_replicas: 1 + index.number_of_shards: 1 + index.max_result_window: 10000 manufacturers: aliases: {} mappings: diff --git a/config/schema/artifacts_with_apollo/json_schemas.yaml b/config/schema/artifacts_with_apollo/json_schemas.yaml index 64c6f7129..ecdf9062b 100644 --- a/config/schema/artifacts_with_apollo/json_schemas.yaml +++ b/config/schema/artifacts_with_apollo/json_schemas.yaml @@ -28,6 +28,8 @@ json_schema_version: 1 - Component - DirectWholesaler - ElectricalPart + - InspectionNote + - InspectionSummary - Manufacturer - MechanicalPart - OnlineStore @@ -372,6 +374,62 @@ json_schema_version: 1 - coordinates ID: type: string + InspectionNote: + type: object + properties: + id: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + widget_inspection_guid: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + note: + anyOf: + - allOf: + - "$ref": "#/$defs/String" + - maxLength: 8191 + - type: 'null' + created_at: + "$ref": "#/$defs/DateTime" + __typename: + type: string + const: InspectionNote + default: InspectionNote + required: + - id + - widget_inspection_guid + - note + - created_at + InspectionSummary: + type: object + properties: + id: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + widget_inspection_guid: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + summary: + anyOf: + - allOf: + - "$ref": "#/$defs/String" + - maxLength: 8191 + - type: 'null' + created_at: + "$ref": "#/$defs/DateTime" + __typename: + type: string + const: InspectionSummary + default: InspectionSummary + required: + - id + - widget_inspection_guid + - summary + - created_at Int: type: integer minimum: -2147483648 @@ -1068,6 +1126,10 @@ json_schema_version: 1 - "$ref": "#/$defs/Untyped" - maxLength: 8191 - type: 'null' + inspection: + anyOf: + - "$ref": "#/$defs/WidgetInspection" + - type: 'null' __typename: type: string const: Widget @@ -1105,8 +1167,22 @@ json_schema_version: 1 - amounts - fees - metadata + - inspection description: For more performant queries on this type, please filter on `workspace_id` if possible. + WidgetInspection: + type: object + properties: + guid: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + __typename: + type: string + const: WidgetInspection + default: WidgetInspection + required: + - guid WidgetInternalDetails: type: object properties: diff --git a/config/schema/artifacts_with_apollo/json_schemas_by_version/v1.yaml b/config/schema/artifacts_with_apollo/json_schemas_by_version/v1.yaml index ad09ed3e1..0cc9dd4ab 100644 --- a/config/schema/artifacts_with_apollo/json_schemas_by_version/v1.yaml +++ b/config/schema/artifacts_with_apollo/json_schemas_by_version/v1.yaml @@ -28,6 +28,8 @@ json_schema_version: 1 - Component - DirectWholesaler - ElectricalPart + - InspectionNote + - InspectionSummary - Manufacturer - MechanicalPart - OnlineStore @@ -471,6 +473,86 @@ json_schema_version: 1 - coordinates ID: type: string + InspectionNote: + type: object + properties: + id: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + ElasticGraph: + type: ID! + nameInIndex: id + widget_inspection_guid: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + ElasticGraph: + type: ID! + nameInIndex: widget_inspection_guid + note: + anyOf: + - allOf: + - "$ref": "#/$defs/String" + - maxLength: 8191 + - type: 'null' + ElasticGraph: + type: String + nameInIndex: note + created_at: + "$ref": "#/$defs/DateTime" + ElasticGraph: + type: DateTime! + nameInIndex: created_at + __typename: + type: string + const: InspectionNote + default: InspectionNote + required: + - id + - widget_inspection_guid + - note + - created_at + InspectionSummary: + type: object + properties: + id: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + ElasticGraph: + type: ID! + nameInIndex: id + widget_inspection_guid: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + ElasticGraph: + type: ID! + nameInIndex: widget_inspection_guid + summary: + anyOf: + - allOf: + - "$ref": "#/$defs/String" + - maxLength: 8191 + - type: 'null' + ElasticGraph: + type: String + nameInIndex: summary + created_at: + "$ref": "#/$defs/DateTime" + ElasticGraph: + type: DateTime! + nameInIndex: created_at + __typename: + type: string + const: InspectionSummary + default: InspectionSummary + required: + - id + - widget_inspection_guid + - summary + - created_at Int: type: integer minimum: -2147483648 @@ -1476,6 +1558,13 @@ json_schema_version: 1 ElasticGraph: type: Untyped nameInIndex: metadata + inspection: + anyOf: + - "$ref": "#/$defs/WidgetInspection" + - type: 'null' + ElasticGraph: + type: WidgetInspection + nameInIndex: inspection __typename: type: string const: Widget @@ -1513,8 +1602,25 @@ json_schema_version: 1 - amounts - fees - metadata + - inspection description: For more performant queries on this type, please filter on `workspace_id` if possible. + WidgetInspection: + type: object + properties: + guid: + allOf: + - "$ref": "#/$defs/ID" + - maxLength: 8191 + ElasticGraph: + type: ID! + nameInIndex: guid + __typename: + type: string + const: WidgetInspection + default: WidgetInspection + required: + - guid WidgetInternalDetails: type: object properties: diff --git a/config/schema/artifacts_with_apollo/runtime_metadata.yaml b/config/schema/artifacts_with_apollo/runtime_metadata.yaml index 9d11bdd4a..cf443ef2e 100644 --- a/config/schema/artifacts_with_apollo/runtime_metadata.yaml +++ b/config/schema/artifacts_with_apollo/runtime_metadata.yaml @@ -235,6 +235,74 @@ enum_types_by_name: sort_field: direction: desc field_path: voltage + InspectionNoteSortOrderInput: + values_by_name: + created_at_ASC: + sort_field: + direction: asc + field_path: created_at + created_at_DESC: + sort_field: + direction: desc + field_path: created_at + id_ASC: + sort_field: + direction: asc + field_path: id + id_DESC: + sort_field: + direction: desc + field_path: id + note_ASC: + sort_field: + direction: asc + field_path: note + note_DESC: + sort_field: + direction: desc + field_path: note + widget_inspection_guid_ASC: + sort_field: + direction: asc + field_path: widget_inspection_guid + widget_inspection_guid_DESC: + sort_field: + direction: desc + field_path: widget_inspection_guid + InspectionSummarySortOrderInput: + values_by_name: + created_at_ASC: + sort_field: + direction: asc + field_path: created_at + created_at_DESC: + sort_field: + direction: desc + field_path: created_at + id_ASC: + sort_field: + direction: asc + field_path: id + id_DESC: + sort_field: + direction: desc + field_path: id + summary_ASC: + sort_field: + direction: asc + field_path: summary + summary_DESC: + sort_field: + direction: desc + field_path: summary + widget_inspection_guid_ASC: + sort_field: + direction: asc + field_path: widget_inspection_guid + widget_inspection_guid_DESC: + sort_field: + direction: desc + field_path: widget_inspection_guid InventorSortOrderInput: values_by_name: id_ASC: @@ -523,6 +591,14 @@ enum_types_by_name: sort_field: direction: desc field_path: id + inspection_guid_ASC: + sort_field: + direction: asc + field_path: inspection.guid + inspection_guid_DESC: + sort_field: + direction: desc + field_path: inspection.guid internal_details_name_ASC: sort_field: direction: asc @@ -1215,6 +1291,14 @@ enum_types_by_name: sort_field: direction: desc field_path: id + inspection_guid_ASC: + sort_field: + direction: asc + field_path: inspection.guid + inspection_guid_DESC: + sort_field: + direction: desc + field_path: inspection.guid internal_details_name_ASC: sort_field: direction: asc @@ -1537,6 +1621,14 @@ enum_types_by_name: sort_field: direction: desc field_path: id + inspection_guid_ASC: + sort_field: + direction: asc + field_path: inspection.guid + inspection_guid_DESC: + sort_field: + direction: desc + field_path: inspection.guid internal_details_name_ASC: sort_field: direction: asc @@ -1941,6 +2033,38 @@ index_definitions_by_name: voltage: source: __self route_with: id + inspection_notes: + current_sources: + - __self + default_sort_fields: + - direction: desc + field_path: created_at + fields_by_path: + created_at: + source: __self + id: + source: __self + note: + source: __self + widget_inspection_guid: + source: __self + route_with: id + inspection_summaries: + current_sources: + - __self + default_sort_fields: + - direction: desc + field_path: created_at + fields_by_path: + created_at: + source: __self + id: + source: __self + summary: + source: __self + widget_inspection_guid: + source: __self + route_with: id manufacturers: current_sources: - __self @@ -3011,6 +3135,8 @@ index_definitions_by_name: source: __self id: source: __self + inspection.guid: + source: __self internal_details.name: source: __self internal_highlightable_details.name: @@ -3089,6 +3215,7 @@ object_types_by_name: relation: direction: out foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships shapes: @@ -3366,6 +3493,7 @@ object_types_by_name: - 100 direction: in foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships id: @@ -3399,12 +3527,14 @@ object_types_by_name: relation: direction: out foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships parts: relation: direction: out foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships position: @@ -3417,12 +3547,14 @@ object_types_by_name: relation: direction: in foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships widget_aggregations: relation: direction: in foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships widget_cost: @@ -3445,6 +3577,7 @@ object_types_by_name: relation: direction: in foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships index_definition_names: @@ -3677,12 +3810,14 @@ object_types_by_name: relation: direction: in foreign_key: country_code + referenced_field_name: id resolver: name: nested_relationships teams: relation: direction: in foreign_key: country_code + referenced_field_name: id resolver: name: nested_relationships CurrencyDetails: @@ -3956,12 +4091,14 @@ object_types_by_name: relation: direction: in foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships components: relation: direction: in foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships created_at: @@ -3974,6 +4111,7 @@ object_types_by_name: relation: direction: out foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships name: @@ -4160,6 +4298,286 @@ object_types_by_name: graphql_fields_by_name: count: name_in_index: __counts + InspectionNote: + graphql_fields_by_name: + created_at: + resolver: + name: get_record_field_value + id: + resolver: + name: get_record_field_value + note: + resolver: + name: get_record_field_value + widget_inspection_guid: + resolver: + name: get_record_field_value + index_definition_names: + - inspection_notes + update_targets: + - data_params: + created_at: + cardinality: one + note: + cardinality: one + widget_inspection_guid: + cardinality: one + id_source: id + metadata_params: + relationship: + value: __self + sourceId: + cardinality: one + source_path: id + sourceType: + cardinality: one + source_path: type + version: + cardinality: one + relationship: __self + routing_value_source: id + script_id: update_index_data_1fdfaf1c9261c96019decc89b515bd9a + type: InspectionNote + InspectionNoteAggregatedValues: + graphql_fields_by_name: + created_at: + resolver: + name: object_with_lookahead + id: + resolver: + name: object_with_lookahead + note: + resolver: + name: object_with_lookahead + widget_inspection_guid: + resolver: + name: object_with_lookahead + InspectionNoteAggregation: + elasticgraph_category: indexed_aggregation + graphql_fields_by_name: + aggregated_values: + resolver: + name: object_without_lookahead + count: + resolver: + name: object_without_lookahead + grouped_by: + resolver: + name: object_without_lookahead + source_type: InspectionNote + InspectionNoteAggregationConnection: + elasticgraph_category: relay_connection + graphql_fields_by_name: + edges: + resolver: + name: object_without_lookahead + nodes: + resolver: + name: object_without_lookahead + page_info: + resolver: + name: object_without_lookahead + InspectionNoteAggregationEdge: + elasticgraph_category: relay_edge + graphql_fields_by_name: + cursor: + resolver: + name: object_without_lookahead + node: + resolver: + name: object_without_lookahead + InspectionNoteConnection: + elasticgraph_category: relay_connection + graphql_fields_by_name: + edges: + resolver: + name: object_without_lookahead + nodes: + resolver: + name: object_without_lookahead + page_info: + resolver: + name: object_without_lookahead + total_edge_count: + resolver: + name: object_without_lookahead + InspectionNoteEdge: + elasticgraph_category: relay_edge + graphql_fields_by_name: + all_highlights: + resolver: + name: object_without_lookahead + cursor: + resolver: + name: object_without_lookahead + highlights: + resolver: + name: object_without_lookahead + node: + resolver: + name: object_without_lookahead + InspectionNoteGroupedBy: + graphql_fields_by_name: + created_at: + resolver: + name: object_with_lookahead + note: + resolver: + name: object_with_lookahead + widget_inspection_guid: + resolver: + name: object_with_lookahead + InspectionNoteHighlights: + graphql_fields_by_name: + id: + resolver: + name: get_record_field_value + note: + resolver: + name: get_record_field_value + widget_inspection_guid: + resolver: + name: get_record_field_value + InspectionSummary: + graphql_fields_by_name: + created_at: + resolver: + name: get_record_field_value + id: + resolver: + name: get_record_field_value + summary: + resolver: + name: get_record_field_value + widget_inspection_guid: + resolver: + name: get_record_field_value + index_definition_names: + - inspection_summaries + update_targets: + - data_params: + created_at: + cardinality: one + summary: + cardinality: one + widget_inspection_guid: + cardinality: one + id_source: id + metadata_params: + relationship: + value: __self + sourceId: + cardinality: one + source_path: id + sourceType: + cardinality: one + source_path: type + version: + cardinality: one + relationship: __self + routing_value_source: id + script_id: update_index_data_1fdfaf1c9261c96019decc89b515bd9a + type: InspectionSummary + InspectionSummaryAggregatedValues: + graphql_fields_by_name: + created_at: + resolver: + name: object_with_lookahead + id: + resolver: + name: object_with_lookahead + summary: + resolver: + name: object_with_lookahead + widget_inspection_guid: + resolver: + name: object_with_lookahead + InspectionSummaryAggregation: + elasticgraph_category: indexed_aggregation + graphql_fields_by_name: + aggregated_values: + resolver: + name: object_without_lookahead + count: + resolver: + name: object_without_lookahead + grouped_by: + resolver: + name: object_without_lookahead + source_type: InspectionSummary + InspectionSummaryAggregationConnection: + elasticgraph_category: relay_connection + graphql_fields_by_name: + edges: + resolver: + name: object_without_lookahead + nodes: + resolver: + name: object_without_lookahead + page_info: + resolver: + name: object_without_lookahead + InspectionSummaryAggregationEdge: + elasticgraph_category: relay_edge + graphql_fields_by_name: + cursor: + resolver: + name: object_without_lookahead + node: + resolver: + name: object_without_lookahead + InspectionSummaryConnection: + elasticgraph_category: relay_connection + graphql_fields_by_name: + edges: + resolver: + name: object_without_lookahead + nodes: + resolver: + name: object_without_lookahead + page_info: + resolver: + name: object_without_lookahead + total_edge_count: + resolver: + name: object_without_lookahead + InspectionSummaryEdge: + elasticgraph_category: relay_edge + graphql_fields_by_name: + all_highlights: + resolver: + name: object_without_lookahead + cursor: + resolver: + name: object_without_lookahead + highlights: + resolver: + name: object_without_lookahead + node: + resolver: + name: object_without_lookahead + InspectionSummaryGroupedBy: + graphql_fields_by_name: + created_at: + resolver: + name: object_with_lookahead + summary: + resolver: + name: object_with_lookahead + widget_inspection_guid: + resolver: + name: object_with_lookahead + InspectionSummaryHighlights: + graphql_fields_by_name: + id: + resolver: + name: get_record_field_value + summary: + resolver: + name: get_record_field_value + widget_inspection_guid: + resolver: + name: get_record_field_value IntAggregatedValues: elasticgraph_category: scalar_aggregated_values graphql_fields_by_name: @@ -4441,6 +4859,7 @@ object_types_by_name: relation: direction: in foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships ceo: @@ -4456,12 +4875,14 @@ object_types_by_name: relation: direction: in foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships manufactured_parts: relation: direction: in foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships name: @@ -4599,12 +5020,14 @@ object_types_by_name: relation: direction: in foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships components: relation: direction: in foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships created_at: @@ -4617,6 +5040,7 @@ object_types_by_name: relation: direction: out foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships material: @@ -4796,6 +5220,7 @@ object_types_by_name: relation: direction: in foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships amount_cents: @@ -4815,12 +5240,14 @@ object_types_by_name: relation: direction: out foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships components: relation: direction: out foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships cost: @@ -4866,6 +5293,7 @@ object_types_by_name: - 100 direction: in foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships fees: @@ -4874,6 +5302,9 @@ object_types_by_name: id: resolver: name: get_record_field_value + inspection: + resolver: + name: get_record_field_value internal_details: resolver: name: get_record_field_value @@ -4893,18 +5324,21 @@ object_types_by_name: relation: direction: in foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships manufactured_parts: relation: direction: in foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships manufacturer: relation: direction: out foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships material: @@ -4950,12 +5384,14 @@ object_types_by_name: relation: direction: out foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships parts: relation: direction: out foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships position: @@ -4991,12 +5427,14 @@ object_types_by_name: relation: direction: in foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships widget_aggregations: relation: direction: in foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships widget_cost: @@ -5019,6 +5457,7 @@ object_types_by_name: relation: direction: in foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships workspace_id: @@ -5080,6 +5519,9 @@ object_types_by_name: id: resolver: name: object_with_lookahead + inspection: + resolver: + name: object_with_lookahead internal_details: resolver: name: object_with_lookahead @@ -5288,6 +5730,9 @@ object_types_by_name: fees: resolver: name: object_with_lookahead + inspection: + resolver: + name: object_with_lookahead internal_details: resolver: name: object_with_lookahead @@ -5399,6 +5844,9 @@ object_types_by_name: id: resolver: name: get_record_field_value + inspection: + resolver: + name: get_record_field_value internal_highlightable_details: resolver: name: get_record_field_value @@ -5656,12 +6104,14 @@ object_types_by_name: relation: direction: in foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships components: relation: direction: in foreign_key: part_ids + referenced_field_name: id resolver: name: nested_relationships created_at: @@ -5674,6 +6124,7 @@ object_types_by_name: relation: direction: out foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships material: @@ -6151,6 +6602,18 @@ object_types_by_name: electrical_parts: resolver: name: indexed_type_root_fields + inspection_note_aggregations: + resolver: + name: indexed_type_root_fields + inspection_notes: + resolver: + name: indexed_type_root_fields + inspection_summaries: + resolver: + name: indexed_type_root_fields + inspection_summary_aggregations: + resolver: + name: indexed_type_root_fields inventor_aggregations: resolver: name: indexed_type_root_fields @@ -6387,12 +6850,14 @@ object_types_by_name: foreign_key_nested_paths: - current_players_nested - current_players_nested.affiliations.sponsorships_nested + referenced_field_name: id resolver: name: nested_relationships affiliated_team_from_object_aggregations: relation: direction: in foreign_key: current_players_object.affiliations.sponsorships_object.sponsor_id + referenced_field_name: id resolver: name: nested_relationships affiliated_teams_from_nested: @@ -6402,12 +6867,14 @@ object_types_by_name: foreign_key_nested_paths: - current_players_nested - current_players_nested.affiliations.sponsorships_nested + referenced_field_name: id resolver: name: nested_relationships affiliated_teams_from_object: relation: direction: in foreign_key: current_players_object.affiliations.sponsorships_object.sponsor_id + referenced_field_name: id resolver: name: nested_relationships id: @@ -7725,12 +8192,14 @@ object_types_by_name: relation: direction: out foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships components: relation: direction: out foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships cost: @@ -7773,6 +8242,9 @@ object_types_by_name: id: resolver: name: get_record_field_value + inspection: + resolver: + name: get_record_field_value internal_details: resolver: name: get_record_field_value @@ -7897,6 +8369,8 @@ object_types_by_name: cardinality: one fees: cardinality: one + inspection: + cardinality: one internal_details: cardinality: one internal_highlightable_details: @@ -8028,6 +8502,9 @@ object_types_by_name: id: resolver: name: object_with_lookahead + inspection: + resolver: + name: object_with_lookahead internal_details: resolver: name: object_with_lookahead @@ -8462,6 +8939,9 @@ object_types_by_name: fees: resolver: name: object_with_lookahead + inspection: + resolver: + name: object_with_lookahead internal_details: resolver: name: object_with_lookahead @@ -8548,6 +9028,9 @@ object_types_by_name: id: resolver: name: get_record_field_value + inspection: + resolver: + name: get_record_field_value internal_highlightable_details: resolver: name: get_record_field_value @@ -8590,6 +9073,47 @@ object_types_by_name: workspace_name: resolver: name: get_record_field_value + WidgetInspection: + graphql_fields_by_name: + guid: + resolver: + name: get_record_field_value + inspection_note_aggregations: + relation: + direction: in + foreign_key: widget_inspection_guid + referenced_field_name: guid + resolver: + name: nested_relationships + inspection_notes: + relation: + direction: in + foreign_key: widget_inspection_guid + referenced_field_name: guid + resolver: + name: nested_relationships + inspection_summary: + relation: + direction: in + foreign_key: widget_inspection_guid + referenced_field_name: guid + resolver: + name: nested_relationships + WidgetInspectionAggregatedValues: + graphql_fields_by_name: + guid: + resolver: + name: object_with_lookahead + WidgetInspectionGroupedBy: + graphql_fields_by_name: + guid: + resolver: + name: object_with_lookahead + WidgetInspectionHighlights: + graphql_fields_by_name: + guid: + resolver: + name: get_record_field_value WidgetInternalDetailsAggregatedValues: graphql_fields_by_name: name: @@ -8706,12 +9230,14 @@ object_types_by_name: relation: direction: out foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships components: relation: direction: out foreign_key: component_ids + referenced_field_name: id resolver: name: nested_relationships cost: @@ -8760,6 +9286,9 @@ object_types_by_name: id: resolver: name: get_record_field_value + inspection: + resolver: + name: get_record_field_value internal_details: resolver: name: get_record_field_value @@ -8779,6 +9308,7 @@ object_types_by_name: relation: direction: out foreign_key: manufacturer_id + referenced_field_name: id resolver: name: nested_relationships metadata: @@ -8887,6 +9417,9 @@ object_types_by_name: id: resolver: name: object_with_lookahead + inspection: + resolver: + name: object_with_lookahead internal_details: resolver: name: object_with_lookahead @@ -9074,6 +9607,9 @@ object_types_by_name: full_address: resolver: name: object_with_lookahead + inspection: + resolver: + name: object_with_lookahead internal_details: resolver: name: object_with_lookahead @@ -9166,6 +9702,9 @@ object_types_by_name: id: resolver: name: get_record_field_value + inspection: + resolver: + name: get_record_field_value internal_highlightable_details: resolver: name: get_record_field_value diff --git a/config/schema/artifacts_with_apollo/schema.graphql b/config/schema/artifacts_with_apollo/schema.graphql index 7f97bcee0..d1e9c906e 100644 --- a/config/schema/artifacts_with_apollo/schema.graphql +++ b/config/schema/artifacts_with_apollo/schema.graphql @@ -3856,6 +3856,610 @@ input IDListFilterInput { not: IDListFilterInput } +type InspectionNote @key(fields: "id") { + created_at: DateTime! + id: ID! + note: String + widget_inspection_guid: ID! +} + +""" +Type used to perform aggregation computations on `InspectionNote` fields. +""" +type InspectionNoteAggregatedValues { + """ + Computed aggregate values for the `created_at` field. + """ + created_at: DateTimeAggregatedValues + + """ + Computed aggregate values for the `id` field. + """ + id: NonNumericAggregatedValues + + """ + Computed aggregate values for the `note` field. + """ + note: NonNumericAggregatedValues + + """ + Computed aggregate values for the `widget_inspection_guid` field. + """ + widget_inspection_guid: NonNumericAggregatedValues +} + +""" +Return type representing a bucket of `InspectionNote` documents for an aggregations query. +""" +type InspectionNoteAggregation { + """ + Provides computed aggregated values over all `InspectionNote` documents in an aggregation bucket. + """ + aggregated_values: InspectionNoteAggregatedValues + + """ + The count of `InspectionNote` documents in an aggregation bucket. + """ + count: JsonSafeLong! + + """ + Used to specify the `InspectionNote` fields to group by. The returned values identify each aggregation bucket. + """ + grouped_by: InspectionNoteGroupedBy +} + +""" +Represents a paginated collection of `InspectionNoteAggregation` results. + +See the [Relay GraphQL Cursor Connections +Specification](https://relay.dev/graphql/connections.htm#sec-Connection-Types) for more info. +""" +type InspectionNoteAggregationConnection { + """ + Wraps a specific `InspectionNoteAggregation` to pair it with its pagination cursor. + """ + edges: [InspectionNoteAggregationEdge!]! + + """ + The list of `InspectionNoteAggregation` results. + """ + nodes: [InspectionNoteAggregation!]! + + """ + Provides pagination-related information. + """ + page_info: PageInfo! +} + +""" +Represents a specific `InspectionNoteAggregation` in the context of a `InspectionNoteAggregationConnection`, +providing access to both the `InspectionNoteAggregation` and query-specific information such as the pagination `Cursor`. + +See the [Relay GraphQL Cursor Connections +Specification](https://relay.dev/graphql/connections.htm#sec-Edge-Types) for more info. +""" +type InspectionNoteAggregationEdge { + """ + The `Cursor` of this `InspectionNoteAggregation`. This can be passed in the next query as + a `before` or `after` argument to continue paginating from this `InspectionNoteAggregation`. + """ + cursor: Cursor + + """ + The `InspectionNoteAggregation` of this edge. + """ + node: InspectionNoteAggregation +} + +""" +Represents a paginated collection of `InspectionNote` results. + +See the [Relay GraphQL Cursor Connections +Specification](https://relay.dev/graphql/connections.htm#sec-Connection-Types) for more info. +""" +type InspectionNoteConnection { + """ + Wraps a specific `InspectionNote` to pair it with its pagination cursor. + """ + edges: [InspectionNoteEdge!]! + + """ + The list of `InspectionNote` results. + """ + nodes: [InspectionNote!]! + + """ + Provides pagination-related information. + """ + page_info: PageInfo! + + """ + The total number of edges available in this connection to paginate over. + """ + total_edge_count: JsonSafeLong! +} + +""" +Represents a specific `InspectionNote` in the context of a `InspectionNoteConnection`, +providing access to both the `InspectionNote` and query-specific information such as the pagination `Cursor`. + +See the [Relay GraphQL Cursor Connections +Specification](https://relay.dev/graphql/connections.htm#sec-Edge-Types) for more info. +""" +type InspectionNoteEdge { + """ + All search highlights for this `InspectionNote`, indicating where in the indexed document the query matched. + """ + all_highlights: [SearchHighlight!]! + + """ + The `Cursor` of this `InspectionNote`. This can be passed in the next query as + a `before` or `after` argument to continue paginating from this `InspectionNote`. + """ + cursor: Cursor + + """ + Specific search highlights for this `InspectionNote`, providing matching snippets for the requested fields. + """ + highlights: InspectionNoteHighlights + + """ + The `InspectionNote` of this edge. + """ + node: InspectionNote +} + +""" +Input type used to specify filters on `InspectionNote` fields. + +Will match all documents if passed as an empty object (or as `null`). +""" +input InspectionNoteFilterInput { + """ + Matches records where all of the provided sub-filters evaluate to true. This works just like an AND operator in SQL. + + Note: multiple filters are automatically ANDed together. This is only needed when you have multiple filters that can't + be provided on a single `InspectionNoteFilterInput` input because of + collisions between key names. For example, if you want to AND multiple + OR'd sub-filters (the equivalent of (A OR B) AND (C OR D)), you could do all_of: [{any_of: [...]}, {any_of: [...]}]. + + When `null` or an empty list is passed, matches all documents. + """ + all_of: [InspectionNoteFilterInput!] + + """ + Matches records where any of the provided sub-filters evaluate to true. + This works just like an OR operator in SQL. + + When `null` is passed, matches all documents. + When an empty list is passed, this part of the filter matches no documents. + """ + any_of: [InspectionNoteFilterInput!] + + """ + Used to filter on the `created_at` field. + + When `null` or an empty object is passed, matches all documents. + """ + created_at: DateTimeFilterInput + + """ + Used to filter on the `id` field. + + When `null` or an empty object is passed, matches all documents. + """ + id: IDFilterInput + + """ + Matches records where the provided sub-filter evaluates to false. + This works just like a NOT operator in SQL. + + When `null` or an empty object is passed, matches no documents. + """ + not: InspectionNoteFilterInput + + """ + Used to filter on the `note` field. + + When `null` or an empty object is passed, matches all documents. + """ + note: StringFilterInput + + """ + Used to filter on the `widget_inspection_guid` field. + + When `null` or an empty object is passed, matches all documents. + """ + widget_inspection_guid: IDFilterInput +} + +""" +Type used to specify the `InspectionNote` fields to group by for aggregations. +""" +type InspectionNoteGroupedBy { + """ + Offers the different grouping options for the `created_at` value within this group. + """ + created_at: DateTimeGroupedBy + + """ + The `note` field value for this group. + """ + note: String + + """ + The `widget_inspection_guid` field value for this group. + """ + widget_inspection_guid: ID +} + +""" +Type used to request desired `InspectionNote` search highlight fields. +""" +type InspectionNoteHighlights { + """ + Search highlights for the `id`, providing snippets of the matching text. + """ + id: [String!]! + + """ + Search highlights for the `note`, providing snippets of the matching text. + """ + note: [String!]! + + """ + Search highlights for the `widget_inspection_guid`, providing snippets of the matching text. + """ + widget_inspection_guid: [String!]! +} + +""" +Enumerates the ways `InspectionNote`s can be sorted. +""" +enum InspectionNoteSortOrderInput { + """ + Sorts ascending by the `created_at` field. + """ + created_at_ASC + + """ + Sorts descending by the `created_at` field. + """ + created_at_DESC + + """ + Sorts ascending by the `id` field. + """ + id_ASC + + """ + Sorts descending by the `id` field. + """ + id_DESC + + """ + Sorts ascending by the `note` field. + """ + note_ASC + + """ + Sorts descending by the `note` field. + """ + note_DESC + + """ + Sorts ascending by the `widget_inspection_guid` field. + """ + widget_inspection_guid_ASC + + """ + Sorts descending by the `widget_inspection_guid` field. + """ + widget_inspection_guid_DESC +} + +type InspectionSummary @key(fields: "id") { + created_at: DateTime! + id: ID! + summary: String + widget_inspection_guid: ID! +} + +""" +Type used to perform aggregation computations on `InspectionSummary` fields. +""" +type InspectionSummaryAggregatedValues { + """ + Computed aggregate values for the `created_at` field. + """ + created_at: DateTimeAggregatedValues + + """ + Computed aggregate values for the `id` field. + """ + id: NonNumericAggregatedValues + + """ + Computed aggregate values for the `summary` field. + """ + summary: NonNumericAggregatedValues + + """ + Computed aggregate values for the `widget_inspection_guid` field. + """ + widget_inspection_guid: NonNumericAggregatedValues +} + +""" +Return type representing a bucket of `InspectionSummary` documents for an aggregations query. +""" +type InspectionSummaryAggregation { + """ + Provides computed aggregated values over all `InspectionSummary` documents in an aggregation bucket. + """ + aggregated_values: InspectionSummaryAggregatedValues + + """ + The count of `InspectionSummary` documents in an aggregation bucket. + """ + count: JsonSafeLong! + + """ + Used to specify the `InspectionSummary` fields to group by. The returned values identify each aggregation bucket. + """ + grouped_by: InspectionSummaryGroupedBy +} + +""" +Represents a paginated collection of `InspectionSummaryAggregation` results. + +See the [Relay GraphQL Cursor Connections +Specification](https://relay.dev/graphql/connections.htm#sec-Connection-Types) for more info. +""" +type InspectionSummaryAggregationConnection { + """ + Wraps a specific `InspectionSummaryAggregation` to pair it with its pagination cursor. + """ + edges: [InspectionSummaryAggregationEdge!]! + + """ + The list of `InspectionSummaryAggregation` results. + """ + nodes: [InspectionSummaryAggregation!]! + + """ + Provides pagination-related information. + """ + page_info: PageInfo! +} + +""" +Represents a specific `InspectionSummaryAggregation` in the context of a `InspectionSummaryAggregationConnection`, +providing access to both the `InspectionSummaryAggregation` and query-specific information such as the pagination `Cursor`. + +See the [Relay GraphQL Cursor Connections +Specification](https://relay.dev/graphql/connections.htm#sec-Edge-Types) for more info. +""" +type InspectionSummaryAggregationEdge { + """ + The `Cursor` of this `InspectionSummaryAggregation`. This can be passed in the next query as + a `before` or `after` argument to continue paginating from this `InspectionSummaryAggregation`. + """ + cursor: Cursor + + """ + The `InspectionSummaryAggregation` of this edge. + """ + node: InspectionSummaryAggregation +} + +""" +Represents a paginated collection of `InspectionSummary` results. + +See the [Relay GraphQL Cursor Connections +Specification](https://relay.dev/graphql/connections.htm#sec-Connection-Types) for more info. +""" +type InspectionSummaryConnection { + """ + Wraps a specific `InspectionSummary` to pair it with its pagination cursor. + """ + edges: [InspectionSummaryEdge!]! + + """ + The list of `InspectionSummary` results. + """ + nodes: [InspectionSummary!]! + + """ + Provides pagination-related information. + """ + page_info: PageInfo! + + """ + The total number of edges available in this connection to paginate over. + """ + total_edge_count: JsonSafeLong! +} + +""" +Represents a specific `InspectionSummary` in the context of a `InspectionSummaryConnection`, +providing access to both the `InspectionSummary` and query-specific information such as the pagination `Cursor`. + +See the [Relay GraphQL Cursor Connections +Specification](https://relay.dev/graphql/connections.htm#sec-Edge-Types) for more info. +""" +type InspectionSummaryEdge { + """ + All search highlights for this `InspectionSummary`, indicating where in the indexed document the query matched. + """ + all_highlights: [SearchHighlight!]! + + """ + The `Cursor` of this `InspectionSummary`. This can be passed in the next query as + a `before` or `after` argument to continue paginating from this `InspectionSummary`. + """ + cursor: Cursor + + """ + Specific search highlights for this `InspectionSummary`, providing matching snippets for the requested fields. + """ + highlights: InspectionSummaryHighlights + + """ + The `InspectionSummary` of this edge. + """ + node: InspectionSummary +} + +""" +Input type used to specify filters on `InspectionSummary` fields. + +Will match all documents if passed as an empty object (or as `null`). +""" +input InspectionSummaryFilterInput { + """ + Matches records where all of the provided sub-filters evaluate to true. This works just like an AND operator in SQL. + + Note: multiple filters are automatically ANDed together. This is only needed when you have multiple filters that can't + be provided on a single `InspectionSummaryFilterInput` input because of + collisions between key names. For example, if you want to AND multiple + OR'd sub-filters (the equivalent of (A OR B) AND (C OR D)), you could do all_of: [{any_of: [...]}, {any_of: [...]}]. + + When `null` or an empty list is passed, matches all documents. + """ + all_of: [InspectionSummaryFilterInput!] + + """ + Matches records where any of the provided sub-filters evaluate to true. + This works just like an OR operator in SQL. + + When `null` is passed, matches all documents. + When an empty list is passed, this part of the filter matches no documents. + """ + any_of: [InspectionSummaryFilterInput!] + + """ + Used to filter on the `created_at` field. + + When `null` or an empty object is passed, matches all documents. + """ + created_at: DateTimeFilterInput + + """ + Used to filter on the `id` field. + + When `null` or an empty object is passed, matches all documents. + """ + id: IDFilterInput + + """ + Matches records where the provided sub-filter evaluates to false. + This works just like a NOT operator in SQL. + + When `null` or an empty object is passed, matches no documents. + """ + not: InspectionSummaryFilterInput + + """ + Used to filter on the `summary` field. + + When `null` or an empty object is passed, matches all documents. + """ + summary: StringFilterInput + + """ + Used to filter on the `widget_inspection_guid` field. + + When `null` or an empty object is passed, matches all documents. + """ + widget_inspection_guid: IDFilterInput +} + +""" +Type used to specify the `InspectionSummary` fields to group by for aggregations. +""" +type InspectionSummaryGroupedBy { + """ + Offers the different grouping options for the `created_at` value within this group. + """ + created_at: DateTimeGroupedBy + + """ + The `summary` field value for this group. + """ + summary: String + + """ + The `widget_inspection_guid` field value for this group. + """ + widget_inspection_guid: ID +} + +""" +Type used to request desired `InspectionSummary` search highlight fields. +""" +type InspectionSummaryHighlights { + """ + Search highlights for the `id`, providing snippets of the matching text. + """ + id: [String!]! + + """ + Search highlights for the `summary`, providing snippets of the matching text. + """ + summary: [String!]! + + """ + Search highlights for the `widget_inspection_guid`, providing snippets of the matching text. + """ + widget_inspection_guid: [String!]! +} + +""" +Enumerates the ways `InspectionSummary`s can be sorted. +""" +enum InspectionSummarySortOrderInput { + """ + Sorts ascending by the `created_at` field. + """ + created_at_ASC + + """ + Sorts descending by the `created_at` field. + """ + created_at_DESC + + """ + Sorts ascending by the `id` field. + """ + id_ASC + + """ + Sorts descending by the `id` field. + """ + id_DESC + + """ + Sorts ascending by the `summary` field. + """ + summary_ASC + + """ + Sorts descending by the `summary` field. + """ + summary_DESC + + """ + Sorts ascending by the `widget_inspection_guid` field. + """ + widget_inspection_guid_ASC + + """ + Sorts descending by the `widget_inspection_guid` field. + """ + widget_inspection_guid_DESC +} + """ A return type used from aggregations to provided aggregated values over `Int` fields. """ @@ -6295,6 +6899,11 @@ type NamedEntityAggregatedValues { """ id: NonNumericAggregatedValues + """ + Computed aggregate values for the `inspection` field. + """ + inspection: WidgetInspectionAggregatedValues + """ Computed aggregate values for the `internal_details` field. """ @@ -6701,6 +7310,13 @@ input NamedEntityFilterInput { """ id: IDFilterInput + """ + Used to filter on the `inspection` field. + + When `null` or an empty object is passed, matches all documents. + """ + inspection: WidgetInspectionFilterInput + """ Used to filter on the `internal_details` field. @@ -6980,6 +7596,11 @@ type NamedEntityGroupedBy { """ fees: MoneyGroupedBy + """ + The `inspection` field value for this group. + """ + inspection: WidgetInspectionGroupedBy + """ The `internal_details` field value for this group. """ @@ -7174,6 +7795,11 @@ type NamedEntityHighlights { """ id: [String!]! + """ + Search highlights for the `inspection`, providing snippets of the matching text. + """ + inspection: WidgetInspectionHighlights + """ Search highlights for the `internal_highlightable_details`, providing snippets of the matching text. """ @@ -7444,6 +8070,16 @@ enum NamedEntitySortOrderInput { """ id_DESC + """ + Sorts ascending by the `inspection.guid` field. + """ + inspection_guid_ASC + + """ + Sorts descending by the `inspection.guid` field. + """ + inspection_guid_DESC + """ Sorts ascending by the `internal_details.name` field. """ @@ -9687,14 +10323,220 @@ type Query { Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. """ last: Int - ): ComponentAggregationConnection + ): ComponentAggregationConnection + + """ + Fetches `Component`s based on the provided arguments. + """ + components( + """ + Used to forward-paginate through the `components`. When provided, the next page after the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + after: Cursor + + """ + Used to backward-paginate through the `components`. When provided, the previous page before the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + before: Cursor + + """ + Used to filter the returned `components` based on the provided criteria. + """ + filter: ComponentFilterInput + + """ + Used in conjunction with the `after` argument to forward-paginate through the `components`. + When provided, limits the number of returned results to the first `n` after the provided + `after` cursor (or from the start of the `components`, if no `after` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + first: Int + + """ + Used in conjunction with the `before` argument to backward-paginate through the `components`. + When provided, limits the number of returned results to the last `n` before the provided + `before` cursor (or from the end of the `components`, if no `before` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + last: Int + + """ + Used to specify how the returned `components` should be sorted. + """ + order_by: [ComponentSortOrderInput!] + ): ComponentConnection + + """ + Aggregations over the `distribution_channels` data: + + > Fetches `DistributionChannel`s based on the provided arguments. + """ + distribution_channel_aggregations( + """ + Used to forward-paginate through the `distribution_channel_aggregations`. When provided, the next page after the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + after: Cursor + + """ + Used to backward-paginate through the `distribution_channel_aggregations`. When provided, the previous page before the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + before: Cursor + + """ + Used to filter the `DistributionChannel` documents that get aggregated over based on the provided criteria. + """ + filter: DistributionChannelFilterInput + + """ + Used in conjunction with the `after` argument to forward-paginate through the `distribution_channel_aggregations`. + When provided, limits the number of returned results to the first `n` after the provided + `after` cursor (or from the start of the `distribution_channel_aggregations`, if no `after` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + first: Int + + """ + Used in conjunction with the `before` argument to backward-paginate through the `distribution_channel_aggregations`. + When provided, limits the number of returned results to the last `n` before the provided + `before` cursor (or from the end of the `distribution_channel_aggregations`, if no `before` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + last: Int + ): DistributionChannelAggregationConnection + + """ + Fetches `DistributionChannel`s based on the provided arguments. + """ + distribution_channels( + """ + Used to forward-paginate through the `distribution_channels`. When provided, the next page after the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + after: Cursor + + """ + Used to backward-paginate through the `distribution_channels`. When provided, the previous page before the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + before: Cursor + + """ + Used to filter the returned `distribution_channels` based on the provided criteria. + """ + filter: DistributionChannelFilterInput + + """ + Used in conjunction with the `after` argument to forward-paginate through the `distribution_channels`. + When provided, limits the number of returned results to the first `n` after the provided + `after` cursor (or from the start of the `distribution_channels`, if no `after` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + first: Int + + """ + Used in conjunction with the `before` argument to backward-paginate through the `distribution_channels`. + When provided, limits the number of returned results to the last `n` before the provided + `before` cursor (or from the end of the `distribution_channels`, if no `before` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + last: Int + + """ + Used to specify how the returned `distribution_channels` should be sorted. + """ + order_by: [DistributionChannelSortOrderInput!] + ): DistributionChannelConnection + + """ + Aggregations over the `electrical_parts` data: + + > Fetches `ElectricalPart`s based on the provided arguments. + """ + electrical_part_aggregations( + """ + Used to forward-paginate through the `electrical_part_aggregations`. When provided, the next page after the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + after: Cursor + + """ + Used to backward-paginate through the `electrical_part_aggregations`. When provided, the previous page before the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + before: Cursor + + """ + Used to filter the `ElectricalPart` documents that get aggregated over based on the provided criteria. + """ + filter: ElectricalPartFilterInput + + """ + Used in conjunction with the `after` argument to forward-paginate through the `electrical_part_aggregations`. + When provided, limits the number of returned results to the first `n` after the provided + `after` cursor (or from the start of the `electrical_part_aggregations`, if no `after` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + first: Int + + """ + Used in conjunction with the `before` argument to backward-paginate through the `electrical_part_aggregations`. + When provided, limits the number of returned results to the last `n` before the provided + `before` cursor (or from the end of the `electrical_part_aggregations`, if no `before` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + last: Int + ): ElectricalPartAggregationConnection """ - Fetches `Component`s based on the provided arguments. + Fetches `ElectricalPart`s based on the provided arguments. """ - components( + electrical_parts( """ - Used to forward-paginate through the `components`. When provided, the next page after the + Used to forward-paginate through the `electrical_parts`. When provided, the next page after the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9703,7 +10545,7 @@ type Query { after: Cursor """ - Used to backward-paginate through the `components`. When provided, the previous page before the + Used to backward-paginate through the `electrical_parts`. When provided, the previous page before the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9712,14 +10554,14 @@ type Query { before: Cursor """ - Used to filter the returned `components` based on the provided criteria. + Used to filter the returned `electrical_parts` based on the provided criteria. """ - filter: ComponentFilterInput + filter: ElectricalPartFilterInput """ - Used in conjunction with the `after` argument to forward-paginate through the `components`. + Used in conjunction with the `after` argument to forward-paginate through the `electrical_parts`. When provided, limits the number of returned results to the first `n` after the provided - `after` cursor (or from the start of the `components`, if no `after` cursor is provided). + `after` cursor (or from the start of the `electrical_parts`, if no `after` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. @@ -9727,9 +10569,9 @@ type Query { first: Int """ - Used in conjunction with the `before` argument to backward-paginate through the `components`. + Used in conjunction with the `before` argument to backward-paginate through the `electrical_parts`. When provided, limits the number of returned results to the last `n` before the provided - `before` cursor (or from the end of the `components`, if no `before` cursor is provided). + `before` cursor (or from the end of the `electrical_parts`, if no `before` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. @@ -9737,19 +10579,19 @@ type Query { last: Int """ - Used to specify how the returned `components` should be sorted. + Used to specify how the returned `electrical_parts` should be sorted. """ - order_by: [ComponentSortOrderInput!] - ): ComponentConnection + order_by: [ElectricalPartSortOrderInput!] + ): ElectricalPartConnection """ - Aggregations over the `distribution_channels` data: + Aggregations over the `inspection_notes` data: - > Fetches `DistributionChannel`s based on the provided arguments. + > Fetches `InspectionNote`s based on the provided arguments. """ - distribution_channel_aggregations( + inspection_note_aggregations( """ - Used to forward-paginate through the `distribution_channel_aggregations`. When provided, the next page after the + Used to forward-paginate through the `inspection_note_aggregations`. When provided, the next page after the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9758,7 +10600,7 @@ type Query { after: Cursor """ - Used to backward-paginate through the `distribution_channel_aggregations`. When provided, the previous page before the + Used to backward-paginate through the `inspection_note_aggregations`. When provided, the previous page before the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9767,14 +10609,14 @@ type Query { before: Cursor """ - Used to filter the `DistributionChannel` documents that get aggregated over based on the provided criteria. + Used to filter the `InspectionNote` documents that get aggregated over based on the provided criteria. """ - filter: DistributionChannelFilterInput + filter: InspectionNoteFilterInput """ - Used in conjunction with the `after` argument to forward-paginate through the `distribution_channel_aggregations`. + Used in conjunction with the `after` argument to forward-paginate through the `inspection_note_aggregations`. When provided, limits the number of returned results to the first `n` after the provided - `after` cursor (or from the start of the `distribution_channel_aggregations`, if no `after` cursor is provided). + `after` cursor (or from the start of the `inspection_note_aggregations`, if no `after` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. @@ -9782,22 +10624,22 @@ type Query { first: Int """ - Used in conjunction with the `before` argument to backward-paginate through the `distribution_channel_aggregations`. + Used in conjunction with the `before` argument to backward-paginate through the `inspection_note_aggregations`. When provided, limits the number of returned results to the last `n` before the provided - `before` cursor (or from the end of the `distribution_channel_aggregations`, if no `before` cursor is provided). + `before` cursor (or from the end of the `inspection_note_aggregations`, if no `before` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. """ last: Int - ): DistributionChannelAggregationConnection + ): InspectionNoteAggregationConnection """ - Fetches `DistributionChannel`s based on the provided arguments. + Fetches `InspectionNote`s based on the provided arguments. """ - distribution_channels( + inspection_notes( """ - Used to forward-paginate through the `distribution_channels`. When provided, the next page after the + Used to forward-paginate through the `inspection_notes`. When provided, the next page after the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9806,7 +10648,7 @@ type Query { after: Cursor """ - Used to backward-paginate through the `distribution_channels`. When provided, the previous page before the + Used to backward-paginate through the `inspection_notes`. When provided, the previous page before the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9815,14 +10657,14 @@ type Query { before: Cursor """ - Used to filter the returned `distribution_channels` based on the provided criteria. + Used to filter the returned `inspection_notes` based on the provided criteria. """ - filter: DistributionChannelFilterInput + filter: InspectionNoteFilterInput """ - Used in conjunction with the `after` argument to forward-paginate through the `distribution_channels`. + Used in conjunction with the `after` argument to forward-paginate through the `inspection_notes`. When provided, limits the number of returned results to the first `n` after the provided - `after` cursor (or from the start of the `distribution_channels`, if no `after` cursor is provided). + `after` cursor (or from the start of the `inspection_notes`, if no `after` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. @@ -9830,9 +10672,9 @@ type Query { first: Int """ - Used in conjunction with the `before` argument to backward-paginate through the `distribution_channels`. + Used in conjunction with the `before` argument to backward-paginate through the `inspection_notes`. When provided, limits the number of returned results to the last `n` before the provided - `before` cursor (or from the end of the `distribution_channels`, if no `before` cursor is provided). + `before` cursor (or from the end of the `inspection_notes`, if no `before` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. @@ -9840,19 +10682,17 @@ type Query { last: Int """ - Used to specify how the returned `distribution_channels` should be sorted. + Used to specify how the returned `inspection_notes` should be sorted. """ - order_by: [DistributionChannelSortOrderInput!] - ): DistributionChannelConnection + order_by: [InspectionNoteSortOrderInput!] + ): InspectionNoteConnection """ - Aggregations over the `electrical_parts` data: - - > Fetches `ElectricalPart`s based on the provided arguments. + Fetches `InspectionSummary`s based on the provided arguments. """ - electrical_part_aggregations( + inspection_summaries( """ - Used to forward-paginate through the `electrical_part_aggregations`. When provided, the next page after the + Used to forward-paginate through the `inspection_summaries`. When provided, the next page after the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9861,7 +10701,7 @@ type Query { after: Cursor """ - Used to backward-paginate through the `electrical_part_aggregations`. When provided, the previous page before the + Used to backward-paginate through the `inspection_summaries`. When provided, the previous page before the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9870,14 +10710,14 @@ type Query { before: Cursor """ - Used to filter the `ElectricalPart` documents that get aggregated over based on the provided criteria. + Used to filter the returned `inspection_summaries` based on the provided criteria. """ - filter: ElectricalPartFilterInput + filter: InspectionSummaryFilterInput """ - Used in conjunction with the `after` argument to forward-paginate through the `electrical_part_aggregations`. + Used in conjunction with the `after` argument to forward-paginate through the `inspection_summaries`. When provided, limits the number of returned results to the first `n` after the provided - `after` cursor (or from the start of the `electrical_part_aggregations`, if no `after` cursor is provided). + `after` cursor (or from the start of the `inspection_summaries`, if no `after` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. @@ -9885,22 +10725,29 @@ type Query { first: Int """ - Used in conjunction with the `before` argument to backward-paginate through the `electrical_part_aggregations`. + Used in conjunction with the `before` argument to backward-paginate through the `inspection_summaries`. When provided, limits the number of returned results to the last `n` before the provided - `before` cursor (or from the end of the `electrical_part_aggregations`, if no `before` cursor is provided). + `before` cursor (or from the end of the `inspection_summaries`, if no `before` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. """ last: Int - ): ElectricalPartAggregationConnection + + """ + Used to specify how the returned `inspection_summaries` should be sorted. + """ + order_by: [InspectionSummarySortOrderInput!] + ): InspectionSummaryConnection """ - Fetches `ElectricalPart`s based on the provided arguments. + Aggregations over the `inspection_summaries` data: + + > Fetches `InspectionSummary`s based on the provided arguments. """ - electrical_parts( + inspection_summary_aggregations( """ - Used to forward-paginate through the `electrical_parts`. When provided, the next page after the + Used to forward-paginate through the `inspection_summary_aggregations`. When provided, the next page after the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9909,7 +10756,7 @@ type Query { after: Cursor """ - Used to backward-paginate through the `electrical_parts`. When provided, the previous page before the + Used to backward-paginate through the `inspection_summary_aggregations`. When provided, the previous page before the provided cursor will be returned. See the [Relay GraphQL Cursor Connections @@ -9918,14 +10765,14 @@ type Query { before: Cursor """ - Used to filter the returned `electrical_parts` based on the provided criteria. + Used to filter the `InspectionSummary` documents that get aggregated over based on the provided criteria. """ - filter: ElectricalPartFilterInput + filter: InspectionSummaryFilterInput """ - Used in conjunction with the `after` argument to forward-paginate through the `electrical_parts`. + Used in conjunction with the `after` argument to forward-paginate through the `inspection_summary_aggregations`. When provided, limits the number of returned results to the first `n` after the provided - `after` cursor (or from the start of the `electrical_parts`, if no `after` cursor is provided). + `after` cursor (or from the start of the `inspection_summary_aggregations`, if no `after` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. @@ -9933,20 +10780,15 @@ type Query { first: Int """ - Used in conjunction with the `before` argument to backward-paginate through the `electrical_parts`. + Used in conjunction with the `before` argument to backward-paginate through the `inspection_summary_aggregations`. When provided, limits the number of returned results to the last `n` before the provided - `before` cursor (or from the end of the `electrical_parts`, if no `before` cursor is provided). + `before` cursor (or from the end of the `inspection_summary_aggregations`, if no `before` cursor is provided). See the [Relay GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. """ last: Int - - """ - Used to specify how the returned `electrical_parts` should be sorted. - """ - order_by: [ElectricalPartSortOrderInput!] - ): ElectricalPartConnection + ): InspectionSummaryAggregationConnection """ Aggregations over the `inventors` data: @@ -15971,6 +16813,7 @@ type Widget implements NamedEntity @key(fields: "id") { description: String fees: [Money!]! id: ID! + inspection: WidgetInspection inventor: Inventor metadata: Untyped name: String @@ -16067,6 +16910,11 @@ type WidgetAggregatedValues { """ id: NonNumericAggregatedValues + """ + Computed aggregate values for the `inspection` field. + """ + inspection: WidgetInspectionAggregatedValues + """ Computed aggregate values for the `internal_details` field. """ @@ -17038,6 +17886,13 @@ input WidgetFilterInput { """ id: IDFilterInput + """ + Used to filter on the `inspection` field. + + When `null` or an empty object is passed, matches all documents. + """ + inspection: WidgetInspectionFilterInput + """ Used to filter on the `internal_details` field. @@ -17256,6 +18111,11 @@ type WidgetGroupedBy { """ fees: MoneyGroupedBy + """ + The `inspection` field value for this group. + """ + inspection: WidgetInspectionGroupedBy + """ The `internal_details` field value for this group. """ @@ -17410,6 +18270,11 @@ type WidgetHighlights { """ id: [String!]! + """ + Search highlights for the `inspection`, providing snippets of the matching text. + """ + inspection: WidgetInspectionHighlights + """ Search highlights for the `internal_highlightable_details`, providing snippets of the matching text. """ @@ -17476,6 +18341,181 @@ type WidgetHighlights { workspace_name: [String!]! } +type WidgetInspection { + guid: ID! + + """ + Aggregations over the `inspection_notes` data. + """ + inspection_note_aggregations( + """ + Used to forward-paginate through the `inspection_note_aggregations`. When provided, the next page after the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + after: Cursor + + """ + Used to backward-paginate through the `inspection_note_aggregations`. When provided, the previous page before the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + before: Cursor + + """ + Used to filter the `InspectionNote` documents that get aggregated over based on the provided criteria. + """ + filter: InspectionNoteFilterInput + + """ + Used in conjunction with the `after` argument to forward-paginate through the `inspection_note_aggregations`. + When provided, limits the number of returned results to the first `n` after the provided + `after` cursor (or from the start of the `inspection_note_aggregations`, if no `after` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + first: Int + + """ + Used in conjunction with the `before` argument to backward-paginate through the `inspection_note_aggregations`. + When provided, limits the number of returned results to the last `n` before the provided + `before` cursor (or from the end of the `inspection_note_aggregations`, if no `before` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + last: Int + ): InspectionNoteAggregationConnection + inspection_notes( + """ + Used to forward-paginate through the `inspection_notes`. When provided, the next page after the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + after: Cursor + + """ + Used to backward-paginate through the `inspection_notes`. When provided, the previous page before the + provided cursor will be returned. + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + before: Cursor + + """ + Used to filter the returned `inspection_notes` based on the provided criteria. + """ + filter: InspectionNoteFilterInput + + """ + Used in conjunction with the `after` argument to forward-paginate through the `inspection_notes`. + When provided, limits the number of returned results to the first `n` after the provided + `after` cursor (or from the start of the `inspection_notes`, if no `after` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + first: Int + + """ + Used in conjunction with the `before` argument to backward-paginate through the `inspection_notes`. + When provided, limits the number of returned results to the last `n` before the provided + `before` cursor (or from the end of the `inspection_notes`, if no `before` cursor is provided). + + See the [Relay GraphQL Cursor Connections + Specification](https://relay.dev/graphql/connections.htm#sec-Arguments) for more info. + """ + last: Int + + """ + Used to specify how the returned `inspection_notes` should be sorted. + """ + order_by: [InspectionNoteSortOrderInput!] + ): InspectionNoteConnection + inspection_summary: InspectionSummary +} + +""" +Type used to perform aggregation computations on `WidgetInspection` fields. +""" +type WidgetInspectionAggregatedValues { + """ + Computed aggregate values for the `guid` field. + """ + guid: NonNumericAggregatedValues +} + +""" +Input type used to specify filters on `WidgetInspection` fields. + +Will match all documents if passed as an empty object (or as `null`). +""" +input WidgetInspectionFilterInput { + """ + Matches records where all of the provided sub-filters evaluate to true. This works just like an AND operator in SQL. + + Note: multiple filters are automatically ANDed together. This is only needed when you have multiple filters that can't + be provided on a single `WidgetInspectionFilterInput` input because of + collisions between key names. For example, if you want to AND multiple + OR'd sub-filters (the equivalent of (A OR B) AND (C OR D)), you could do all_of: [{any_of: [...]}, {any_of: [...]}]. + + When `null` or an empty list is passed, matches all documents. + """ + all_of: [WidgetInspectionFilterInput!] + + """ + Matches records where any of the provided sub-filters evaluate to true. + This works just like an OR operator in SQL. + + When `null` is passed, matches all documents. + When an empty list is passed, this part of the filter matches no documents. + """ + any_of: [WidgetInspectionFilterInput!] + + """ + Used to filter on the `guid` field. + + When `null` or an empty object is passed, matches all documents. + """ + guid: IDFilterInput + + """ + Matches records where the provided sub-filter evaluates to false. + This works just like a NOT operator in SQL. + + When `null` or an empty object is passed, matches no documents. + """ + not: WidgetInspectionFilterInput +} + +""" +Type used to specify the `WidgetInspection` fields to group by for aggregations. +""" +type WidgetInspectionGroupedBy { + """ + The `guid` field value for this group. + """ + guid: ID +} + +""" +Type used to request desired `WidgetInspection` search highlight fields. +""" +type WidgetInspectionHighlights { + """ + Search highlights for the `guid`, providing snippets of the matching text. + """ + guid: [String!]! +} + """ Type used to perform aggregation computations on `WidgetInternalDetails` fields. """ @@ -17866,6 +18906,11 @@ type WidgetOrAddressAggregatedValues { """ id: NonNumericAggregatedValues + """ + Computed aggregate values for the `inspection` field. + """ + inspection: WidgetInspectionAggregatedValues + """ Computed aggregate values for the `internal_details` field. """ @@ -18249,6 +19294,13 @@ input WidgetOrAddressFilterInput { """ id: IDFilterInput + """ + Used to filter on the `inspection` field. + + When `null` or an empty object is passed, matches all documents. + """ + inspection: WidgetInspectionFilterInput + """ Used to filter on the `internal_details` field. @@ -18479,6 +19531,11 @@ type WidgetOrAddressGroupedBy { """ full_address: String + """ + The `inspection` field value for this group. + """ + inspection: WidgetInspectionGroupedBy + """ The `internal_details` field value for this group. """ @@ -18643,6 +19700,11 @@ type WidgetOrAddressHighlights { """ id: [String!]! + """ + Search highlights for the `inspection`, providing snippets of the matching text. + """ + inspection: WidgetInspectionHighlights + """ Search highlights for the `internal_highlightable_details`, providing snippets of the matching text. """ @@ -18863,6 +19925,16 @@ enum WidgetOrAddressSortOrderInput { """ id_DESC + """ + Sorts ascending by the `inspection.guid` field. + """ + inspection_guid_ASC + + """ + Sorts descending by the `inspection.guid` field. + """ + inspection_guid_DESC + """ Sorts ascending by the `internal_details.name` field. """ @@ -19268,6 +20340,16 @@ enum WidgetSortOrderInput { """ id_DESC + """ + Sorts ascending by the `inspection.guid` field. + """ + inspection_guid_ASC + + """ + Sorts descending by the `inspection.guid` field. + """ + inspection_guid_DESC + """ Sorts ascending by the `internal_details.name` field. """ @@ -19935,7 +21017,7 @@ In an ElasticGraph schema, this is a union of all indexed types. Not intended for use by clients other than Apollo. """ -union _Entity = BrokerWholesaler | Company | Component | Country | DirectWholesaler | ElectricalPart | Manufacturer | MechanicalPart | OnlineStore | Person | PhysicalStore | Sponsor | Team | Widget | WidgetCurrency | WidgetWorkspace +union _Entity = BrokerWholesaler | Company | Component | Country | DirectWholesaler | ElectricalPart | InspectionNote | InspectionSummary | Manufacturer | MechanicalPart | OnlineStore | Person | PhysicalStore | Sponsor | Team | Widget | WidgetCurrency | WidgetWorkspace """ An object type required by the [Apollo Federation subgraph diff --git a/config/schema/widgets.rb b/config/schema/widgets.rb index 490f85408..82a6e7ce6 100644 --- a/config/schema/widgets.rb +++ b/config/schema/widgets.rb @@ -82,6 +82,41 @@ t.field "y", "Float!" end + # WidgetInspection, InspectionSummary, and InspectionNote are used to test relationships from embedded types + # using the custom `references` parameter. WidgetInspection is an embedded type (no index) that uses `guid` + # as its identifier instead of `id`, demonstrating that the `references` parameter allows customizing which + # field on the embedded type is used for matching when resolving relationships to indexed types. + schema.object_type "WidgetInspection" do |t| + t.field "guid", "ID!" + + t.relates_to_one "inspection_summary", "InspectionSummary", via: "widget_inspection_guid", references: "guid", dir: :in + t.relates_to_many "inspection_notes", "InspectionNote", via: "widget_inspection_guid", references: "guid", dir: :in, singular: "inspection_note" + end + + schema.object_type "InspectionSummary" do |t| + t.root_query_fields plural: "inspection_summaries" + t.field "id", "ID!" + t.field "widget_inspection_guid", "ID!" + t.field "summary", "String" + t.field "created_at", "DateTime!" + + t.index "inspection_summaries" do |i| + i.default_sort "created_at", :desc + end + end + + schema.object_type "InspectionNote" do |t| + t.root_query_fields plural: "inspection_notes" + t.field "id", "ID!" + t.field "widget_inspection_guid", "ID!" + t.field "note", "String" + t.field "created_at", "DateTime!" + + t.index "inspection_notes" do |i| + i.default_sort "created_at", :desc + end + end + schema.object_type "Widget" do |t| t.root_query_fields plural: "widgets" t.implements "NamedEntity" @@ -154,6 +189,8 @@ f.sourced_from "workspace", "name" end + t.field "inspection", "WidgetInspection" + # Customize the index so we can demonstrate that index customization works. # Also, to demonstrate that custom shard routing works correctly, we need multiple shards. # That way, our documents wind up on multiple shards and we can demonstrate that our diff --git a/config/settings/development.yaml b/config/settings/development.yaml index 2f2129e69..41e3dbee7 100644 --- a/config/settings/development.yaml +++ b/config/settings/development.yaml @@ -18,6 +18,8 @@ datastore: setting_overrides_by_timestamp: {} components: *main_index_settings electrical_parts: *main_index_settings + inspection_notes: *main_index_settings + inspection_summaries: *main_index_settings named_inventors: *main_index_settings manufacturers: *main_index_settings mechanical_parts: *main_index_settings diff --git a/config/settings/development_with_apollo.yaml b/config/settings/development_with_apollo.yaml index 9cb085d24..a1a7821a6 100644 --- a/config/settings/development_with_apollo.yaml +++ b/config/settings/development_with_apollo.yaml @@ -18,6 +18,8 @@ datastore: setting_overrides_by_timestamp: {} components: *main_index_settings electrical_parts: *main_index_settings + inspection_notes: *main_index_settings + inspection_summaries: *main_index_settings named_inventors: *main_index_settings manufacturers: *main_index_settings mechanical_parts: *main_index_settings diff --git a/config/settings/test.yaml.template b/config/settings/test.yaml.template index 94ae2e2ca..e97f8e533 100644 --- a/config/settings/test.yaml.template +++ b/config/settings/test.yaml.template @@ -36,6 +36,8 @@ datastore: setting_overrides_by_timestamp: {} components: *main_index_settings electrical_parts: *main_index_settings + inspection_notes: *main_index_settings + inspection_summaries: *main_index_settings named_inventors: *main_index_settings manufacturers: *main_index_settings mechanical_parts: *main_index_settings diff --git a/elasticgraph-graphql/lib/elastic_graph/graphql/schema/relation_join.rb b/elasticgraph-graphql/lib/elastic_graph/graphql/schema/relation_join.rb index 320dbec53..b7c5ab0db 100644 --- a/elasticgraph-graphql/lib/elastic_graph/graphql/schema/relation_join.rb +++ b/elasticgraph-graphql/lib/elastic_graph/graphql/schema/relation_join.rb @@ -33,15 +33,15 @@ def self.from(field) if relation.direction == :in # An inbound foreign key has some field (such as `foo_id`) on another document that points - # back to the `id` field on the document with the relation. + # back to the `referenced_field_name` field on the document with the relation. # - # The cardinality of the document id field on an inbound relation is always 1 since - # it is always the primary key `id` field. - new(field, "id", relation.foreign_key, Cardinality::One, doc_cardinality, relation.additional_filter, relation.foreign_key_nested_paths) + # The cardinality of the referenced field on an inbound relation is always 1 since + # it is expected to be a unique identifier field. + new(field, relation.referenced_field_name, relation.foreign_key, Cardinality::One, doc_cardinality, relation.additional_filter, relation.foreign_key_nested_paths) else # An outbound foreign key has some field (such as `foo_id`) on the document with the relation - # that point out to the `id` field of another document. - new(field, relation.foreign_key, "id", doc_cardinality, doc_cardinality, relation.additional_filter, relation.foreign_key_nested_paths) + # that points out to the `referenced_field_name` field of another document. + new(field, relation.foreign_key, relation.referenced_field_name, doc_cardinality, doc_cardinality, relation.additional_filter, relation.foreign_key_nested_paths) end end diff --git a/elasticgraph-graphql/spec/acceptance/hidden_types_spec.rb b/elasticgraph-graphql/spec/acceptance/hidden_types_spec.rb index e25c611df..5a150affb 100644 --- a/elasticgraph-graphql/spec/acceptance/hidden_types_spec.rb +++ b/elasticgraph-graphql/spec/acceptance/hidden_types_spec.rb @@ -76,6 +76,8 @@ module ElasticGraph all_types_related_to("Part") + all_types_related_to("NamedEntity") + all_types_related_to("WidgetCurrency") + + all_types_related_to("InspectionSummary") + + all_types_related_to("InspectionNote") + all_types_related_to("Team") + all_types_related_to("Sponsor") + all_types_related_to("Inventor") + @@ -110,6 +112,7 @@ module ElasticGraph type_filter_and_non_indexed_aggregation_types_for("PlayerSeason", include_list_filter: true, include_fields_list_filter: true) - ["PlayerSeasonListElementFilterInput"] + type_filter_and_non_indexed_aggregation_types_for("TeamRecord", include_fields_list_filter: true, include_highlights: false) + type_filter_and_non_indexed_aggregation_types_for("TeamSeason", include_list_filter: true, include_fields_list_filter: true) - ["TeamSeasonListElementFilterInput"] + + type_filter_and_non_indexed_aggregation_types_for("WidgetInspection") + type_filter_and_non_indexed_aggregation_types_for("WidgetInternalDetails") - ["WidgetInternalDetails"] + type_filter_and_non_indexed_aggregation_types_for("WidgetOptions") + type_filter_and_non_indexed_aggregation_types_for("WidgetOptionSets") - ["WidgetOptionSetsGroupedBy"] + diff --git a/elasticgraph-graphql/spec/acceptance/nested_relationships_spec.rb b/elasticgraph-graphql/spec/acceptance/nested_relationships_spec.rb index e158c4c95..c1964e9b6 100644 --- a/elasticgraph-graphql/spec/acceptance/nested_relationships_spec.rb +++ b/elasticgraph-graphql/spec/acceptance/nested_relationships_spec.rb @@ -29,11 +29,25 @@ module ElasticGraph let(:component3) { build(:component, parts: [part2, part3], name: "comp3", created_at: "2019-06-02T00:00:00Z") } let(:component4) { build(:component, parts: [part2], name: "comp4", created_at: "2019-06-01T00:00:00Z") } - let(:widget1) { build(:widget, name: "widget1", amount_cents: 100, components: [component1, component2, component4], created_at: "2019-06-02T00:00:00Z") } - let(:widget2) { build(:widget, name: "widget2", amount_cents: 200, components: [component3], created_at: "2019-06-01T00:00:00Z") } + let(:inspection1) { build(:widget_inspection) } + let(:inspection2) { build(:widget_inspection) } + + let(:summary1) { build(:inspection_summary, widget_inspection: inspection1, summary: "summary1") } + let(:summary2) { build(:inspection_summary, widget_inspection: inspection2, summary: "summary2") } + + let(:note1_1) { build(:inspection_note, widget_inspection: inspection1, note: "note1_1") } + let(:note1_2) { build(:inspection_note, widget_inspection: inspection1, note: "note1_2") } + let(:note2_1) { build(:inspection_note, widget_inspection: inspection2, note: "note2_1") } + + let(:widget1) { build(:widget, name: "widget1", amount_cents: 100, components: [component1, component2, component4], inspection: inspection1, created_at: "2019-06-02T00:00:00Z") } + let(:widget2) { build(:widget, name: "widget2", amount_cents: 200, components: [component3], inspection: inspection2, created_at: "2019-06-01T00:00:00Z") } before do - index_records(manufacturer1, manufacturer2, address1, address2, part1, part2, part3, component1, component2, component3, component4, widget1, widget2) + index_records( + manufacturer1, manufacturer2, address1, address2, part1, part2, part3, + component1, component2, component3, component4, widget1, widget2, + summary1, summary2, note1_1, note1_2, note2_1 + ) end it "supports filtering relationships with additional filter conditions" do @@ -374,6 +388,61 @@ module ElasticGraph ) end + it "supports relationships from embedded types using custom `references` parameter" do + results = call_graphql_query(<<~QUERY).dig("data", "widgets", "nodes") + query { + widgets(filter: {name: {equal_to_any_of: ["widget1", "widget2"]}}, order_by: [name_ASC]) { + nodes { + name + inspection { + guid + inspection_summary { + summary + } + inspection_notes(order_by: [note_ASC]) { + nodes { + note + } + } + } + } + } + } + QUERY + + expect(results).to match([ + { + case_correctly("name") => "widget1", + case_correctly("inspection") => { + case_correctly("guid") => inspection1.fetch(:guid), + case_correctly("inspection_summary") => { + case_correctly("summary") => "summary1" + }, + case_correctly("inspection_notes") => { + case_correctly("nodes") => [ + {case_correctly("note") => "note1_1"}, + {case_correctly("note") => "note1_2"} + ] + } + } + }, + { + case_correctly("name") => "widget2", + case_correctly("inspection") => { + case_correctly("guid") => inspection2.fetch(:guid), + case_correctly("inspection_summary") => { + case_correctly("summary") => "summary2" + }, + case_correctly("inspection_notes") => { + case_correctly("nodes") => [ + {case_correctly("note") => "note2_1"} + ] + } + } + } + ]) + end + def case_correctly(string_or_sym) return super(string_or_sym.to_s).to_sym if string_or_sym.is_a?(Symbol) super diff --git a/elasticgraph-schema_artifacts/lib/elastic_graph/schema_artifacts/runtime_metadata/relation.rb b/elasticgraph-schema_artifacts/lib/elastic_graph/schema_artifacts/runtime_metadata/relation.rb index 035c06edc..9810e0869 100644 --- a/elasticgraph-schema_artifacts/lib/elastic_graph/schema_artifacts/runtime_metadata/relation.rb +++ b/elasticgraph-schema_artifacts/lib/elastic_graph/schema_artifacts/runtime_metadata/relation.rb @@ -10,9 +10,10 @@ module ElasticGraph module SchemaArtifacts module RuntimeMetadata # @private - class Relation < ::Data.define(:foreign_key, :direction, :additional_filter, :foreign_key_nested_paths) + class Relation < ::Data.define(:foreign_key, :direction, :referenced_field_name, :additional_filter, :foreign_key_nested_paths) FOREIGN_KEY = "foreign_key" DIRECTION = "direction" + REFERENCED_FIELD_NAME = "referenced_field_name" ADDITIONAL_FILTER = "additional_filter" FOREIGN_KEY_NESTED_PATHS = "foreign_key_nested_paths" @@ -20,6 +21,7 @@ def self.from_hash(hash) new( foreign_key: hash[FOREIGN_KEY], direction: hash.fetch(DIRECTION).to_sym, + referenced_field_name: hash[REFERENCED_FIELD_NAME], additional_filter: hash[ADDITIONAL_FILTER] || {}, foreign_key_nested_paths: hash[FOREIGN_KEY_NESTED_PATHS] || [] ) @@ -31,7 +33,8 @@ def to_dumpable_hash ADDITIONAL_FILTER => additional_filter, DIRECTION => direction.to_s, FOREIGN_KEY => foreign_key, - FOREIGN_KEY_NESTED_PATHS => foreign_key_nested_paths + FOREIGN_KEY_NESTED_PATHS => foreign_key_nested_paths, + REFERENCED_FIELD_NAME => referenced_field_name } end end diff --git a/elasticgraph-schema_artifacts/sig/elastic_graph/schema_artifacts/runtime_metadata/relation.rbs b/elasticgraph-schema_artifacts/sig/elastic_graph/schema_artifacts/runtime_metadata/relation.rbs index c08b3799a..0258b0121 100644 --- a/elasticgraph-schema_artifacts/sig/elastic_graph/schema_artifacts/runtime_metadata/relation.rbs +++ b/elasticgraph-schema_artifacts/sig/elastic_graph/schema_artifacts/runtime_metadata/relation.rbs @@ -4,12 +4,14 @@ module ElasticGraph class RelationSupertype attr_reader foreign_key: ::String attr_reader direction: Relation::direction + attr_reader referenced_field_name: ::String attr_reader additional_filter: ::Hash[::String, untyped] attr_reader foreign_key_nested_paths: ::Array[::String] def initialize: ( foreign_key: ::String, direction: Relation::direction, + referenced_field_name: ::String, additional_filter: ::Hash[::String, untyped], foreign_key_nested_paths: ::Array[::String] ) -> void @@ -20,6 +22,7 @@ module ElasticGraph FOREIGN_KEY: "foreign_key" DIRECTION: "direction" + REFERENCED_FIELD_NAME: "referenced_field_name" ADDITIONAL_FILTER: "additional_filter" FOREIGN_KEY_NESTED_PATHS: "foreign_key_nested_paths" def self.from_hash: (::Hash[::String, untyped]) -> Relation diff --git a/elasticgraph-schema_artifacts/spec/unit/elastic_graph/schema_artifacts/runtime_metadata/relation_spec.rb b/elasticgraph-schema_artifacts/spec/unit/elastic_graph/schema_artifacts/runtime_metadata/relation_spec.rb index f251d2b39..19efdc280 100644 --- a/elasticgraph-schema_artifacts/spec/unit/elastic_graph/schema_artifacts/runtime_metadata/relation_spec.rb +++ b/elasticgraph-schema_artifacts/spec/unit/elastic_graph/schema_artifacts/runtime_metadata/relation_spec.rb @@ -16,11 +16,12 @@ module RuntimeMetadata include RuntimeMetadataSupport it "builds from a minimal hash" do - relation = Relation.from_hash({"direction" => "in"}) + relation = Relation.from_hash({"direction" => "in", "referenced_field_name" => "id"}) expect(relation).to eq Relation.new( direction: :in, foreign_key: nil, + referenced_field_name: "id", additional_filter: {}, foreign_key_nested_paths: [] ) diff --git a/elasticgraph-schema_artifacts/spec/unit/elastic_graph/schema_artifacts/runtime_metadata/schema_spec.rb b/elasticgraph-schema_artifacts/spec/unit/elastic_graph/schema_artifacts/runtime_metadata/schema_spec.rb index 1b8041cbe..c4930c878 100644 --- a/elasticgraph-schema_artifacts/spec/unit/elastic_graph/schema_artifacts/runtime_metadata/schema_spec.rb +++ b/elasticgraph-schema_artifacts/spec/unit/elastic_graph/schema_artifacts/runtime_metadata/schema_spec.rb @@ -69,6 +69,7 @@ module RuntimeMetadata relation: Relation.new( foreign_key: "grandparents.parents.some_id", direction: :out, + referenced_field_name: "id", additional_filter: {"flag_field" => {"equalToAnyOf" => [true]}}, foreign_key_nested_paths: ["grandparents", "grandparents.parents"] ), @@ -186,10 +187,11 @@ module RuntimeMetadata }, "parent" => { "relation" => { - "foreign_key" => "grandparents.parents.some_id", - "direction" => "out", "additional_filter" => {"flag_field" => {"equalToAnyOf" => [true]}}, - "foreign_key_nested_paths" => ["grandparents", "grandparents.parents"] + "direction" => "out", + "foreign_key" => "grandparents.parents.some_id", + "foreign_key_nested_paths" => ["grandparents", "grandparents.parents"], + "referenced_field_name" => "id" }, "resolver" => {"name" => "self"} }, diff --git a/elasticgraph-schema_definition/lib/elastic_graph/schema_definition/factory.rb b/elasticgraph-schema_definition/lib/elastic_graph/schema_definition/factory.rb index cd1bf8a8f..a7c401f3c 100644 --- a/elasticgraph-schema_definition/lib/elastic_graph/schema_definition/factory.rb +++ b/elasticgraph-schema_definition/lib/elastic_graph/schema_definition/factory.rb @@ -273,13 +273,14 @@ def new_field_source(relationship_name:, field_path:) end @@field_source_new = prevent_non_factory_instantiation_of(SchemaElements::FieldSource) - def new_relationship(field, cardinality:, related_type:, foreign_key:, direction:) + def new_relationship(field, cardinality:, related_type:, foreign_key:, direction:, referenced_field_name:) @@relationship_new.call( field, cardinality: cardinality, related_type: related_type, foreign_key: foreign_key, - direction: direction + direction: direction, + referenced_field_name: referenced_field_name ) end @@relationship_new = prevent_non_factory_instantiation_of(SchemaElements::Relationship) diff --git a/elasticgraph-schema_definition/lib/elastic_graph/schema_definition/indexing/relationship_resolver.rb b/elasticgraph-schema_definition/lib/elastic_graph/schema_definition/indexing/relationship_resolver.rb index db2a68a61..6b4a18ebd 100644 --- a/elasticgraph-schema_definition/lib/elastic_graph/schema_definition/indexing/relationship_resolver.rb +++ b/elasticgraph-schema_definition/lib/elastic_graph/schema_definition/indexing/relationship_resolver.rb @@ -41,9 +41,12 @@ def resolve else relation_metadata = relationship.runtime_metadata # : SchemaArtifacts::RuntimeMetadata::Relation foreign_key_parent_type = (relation_metadata.direction == :in) ? related_type : object_type + referenced_parent_type = (relation_metadata.direction == :in) ? object_type : related_type if (foreign_key_error = validate_foreign_key(foreign_key_parent_type, relation_metadata)) [nil, foreign_key_error] + elsif (referenced_field_error = validate_referenced_field(referenced_parent_type, relation_metadata)) + [nil, referenced_field_error] else [ResolvedRelationship.new(relationship_name, relationship, related_type, relation_metadata), nil] end @@ -85,6 +88,31 @@ def validate_foreign_key(foreign_key_parent_type, relation_metadata) end end + def validate_referenced_field(referenced_parent_type, relation_metadata) + referenced_field = schema_def_state.field_path_resolver.resolve_public_path(referenced_parent_type, relation_metadata.referenced_field_name) { true } + # If it's an outbound relationship, verify that the referenced field exists on the related type. + # Note: we don't verify this for inbound relationships, because when we define a relationship with an inbound + # foreign key, we automatically define an indexing only field for the referenced field (since it exists on the + # same type). We don't do that for outbound relationships, though (since the referenced field exists on another + # type). Allowing a relationship definition on type A to add a field to type B's schema would be weird and surprising. + if relation_metadata.direction == :out && referenced_field.nil? + "#{relationship_error_prefix} uses `#{referenced_parent_type.name}.#{relation_metadata.referenced_field_name}` as the `references` field, " \ + "but that field does not exist as an indexing field. To continue, define it on `#{referenced_parent_type.name}`, " \ + "use another field as the `references` target, or remove the `#{relationship_description}` definition." + # For indexed types (root document types), the referenced field must be "id" (the document ID field). + # This is because the indexer uses foreign key values directly as document IDs for updates + # (see Mixins::HasIndices where normal indexing update targets are created with `id_source: "id"`). + # Embedded types don't have this constraint since they don't have document IDs - the `references` + # parameter is only meaningful for matching nested objects within embedded types. + elsif referenced_parent_type.root_document_type? && relation_metadata.referenced_field_name != "id" + "#{relationship_error_prefix} uses `references: \"#{relation_metadata.referenced_field_name}\"` " \ + "on indexed type `#{referenced_parent_type.name}`, but the `references` parameter can only be customized " \ + "for relationships to embedded types. For indexed types, `references` must be \"id\" because ElasticGraph " \ + "uses foreign key values directly as document `_id` values when updating related documents, and document IDs " \ + "are always sourced from the \"id\" field. To fix this, remove the `references` parameter (it defaults to \"id\")." + end + end + def relationship_description "#{object_type.name}.#{relationship_name}" end diff --git a/elasticgraph-schema_definition/lib/elastic_graph/schema_definition/schema_elements/relationship.rb b/elasticgraph-schema_definition/lib/elastic_graph/schema_definition/schema_elements/relationship.rb index 29c7ec2f0..8d59d7bf3 100644 --- a/elasticgraph-schema_definition/lib/elastic_graph/schema_definition/schema_elements/relationship.rb +++ b/elasticgraph-schema_definition/lib/elastic_graph/schema_definition/schema_elements/relationship.rb @@ -46,13 +46,14 @@ class Relationship < DelegateClass(Field) attr_accessor :hide_relationship_runtime_metadata # @private - def initialize(field, cardinality:, related_type:, foreign_key:, direction:) + def initialize(field, cardinality:, related_type:, foreign_key:, direction:, referenced_field_name:) super(field) self.hide_relationship_runtime_metadata = false @cardinality = cardinality @related_type = related_type @foreign_key = foreign_key @direction = direction + @referenced_field_name = referenced_field_name @equivalent_field_paths_by_local_path = {} @additional_filter = {} end @@ -205,6 +206,7 @@ def runtime_metadata SchemaArtifacts::RuntimeMetadata::Relation.new( foreign_key: @foreign_key, direction: @direction, + referenced_field_name: @referenced_field_name, additional_filter: @additional_filter, foreign_key_nested_paths: foreign_key_nested_paths ) diff --git a/elasticgraph-schema_definition/lib/elastic_graph/schema_definition/schema_elements/type_with_subfields.rb b/elasticgraph-schema_definition/lib/elastic_graph/schema_definition/schema_elements/type_with_subfields.rb index 4fc5f9c2f..786444398 100644 --- a/elasticgraph-schema_definition/lib/elastic_graph/schema_definition/schema_elements/type_with_subfields.rb +++ b/elasticgraph-schema_definition/lib/elastic_graph/schema_definition/schema_elements/type_with_subfields.rb @@ -359,8 +359,12 @@ def paginated_collection_field( # @param type [String] name of the related type # @param via [String] name of the foreign key field # @param dir [:in, :out] direction of the foreign key. Use `:in` for an inbound foreign key that resides on the related type and - # references the `id` of this type. Use `:out` for an outbound foreign key that resides on this type and references the `id` of - # the related type. + # references the identifier of this type. Use `:out` for an outbound foreign key that resides on this type and references the + # identifier of the related type. + # @param references [String] the field that the foreign key points to. Defaults to `"id"`. For indexed types (root document types), + # this must always be `"id"` because document IDs are always sourced from the `id` field. This parameter can only be customized + # when the referenced type is an embedded type (a type without an index), allowing you to match on a different field within + # nested objects (e.g. `"guid"`). # @param indexing_only [Boolean] when true, the relationship is used only for indexing purposes (e.g. `sourced_from`) and will not # generate a GraphQL field. # @yield [Relationship] the generated relationship fields, for further customization @@ -385,9 +389,9 @@ def paginated_collection_field( # t.index "players" # end # end - def relates_to_one(field_name, type, via:, dir:, indexing_only: false, &block) + def relates_to_one(field_name, type, via:, dir:, references: "id", indexing_only: false, &block) foreign_key_type = schema_def_state.type_ref(type).non_null? ? "ID!" : "ID" - relates_to(field_name, type, via: via, dir: dir, foreign_key_type: foreign_key_type, cardinality: :one, related_type: type, indexing_only: indexing_only, &block) + relates_to(field_name, type, via: via, dir: dir, referenced_field_name: references, foreign_key_type: foreign_key_type, cardinality: :one, related_type: type, indexing_only: indexing_only, &block) end # Defines a "has many" relationship between the current indexed type and another indexed type by defining a pair of fields clients @@ -399,8 +403,12 @@ def relates_to_one(field_name, type, via:, dir:, indexing_only: false, &block) # @param type [String] name of the related type # @param via [String] name of the foreign key field # @param dir [:in, :out] direction of the foreign key. Use `:in` for an inbound foreign key that resides on the related type and - # references the `id` of this type. Use `:out` for an outbound foreign key that resides on this type and references the `id` of - # the related type. + # references the identifier of this type. Use `:out` for an outbound foreign key that resides on this type and references the + # identifier of the related type. + # @param references [String] the field that the foreign key points to. Defaults to `"id"`. For indexed types (root document types), + # this must always be `"id"` because document IDs are always sourced from the `id` field. This parameter can only be customized + # when the referenced type is an embedded type (a type without an index), allowing you to match on a different field within + # nested objects (e.g. `"guid"`). # @param singular [String] singular form of the `field_name`; will be used (along with an `Aggregations` suffix) for the name of # the generated aggregations field. Not required when `indexing_only: true`. # @param indexing_only [Boolean] when true, the relationship is used only for indexing purposes (e.g. `sourced_from`) and will not @@ -429,7 +437,7 @@ def relates_to_one(field_name, type, via:, dir:, indexing_only: false, &block) # t.index "players" # end # end - def relates_to_many(field_name, type, via:, dir:, singular: nil, indexing_only: false) + def relates_to_many(field_name, type, via:, dir:, references: "id", singular: nil, indexing_only: false) foreign_key_type = (dir == :out) ? "[ID!]!" : "ID" if singular.nil? && !indexing_only @@ -438,7 +446,7 @@ def relates_to_many(field_name, type, via:, dir:, singular: nil, indexing_only: type_ref = schema_def_state.type_ref(type).to_final_form - relates_to(field_name, type_ref.as_connection.name, via: via, dir: dir, foreign_key_type: foreign_key_type, cardinality: :many, related_type: type, indexing_only: indexing_only) do |f| + relates_to(field_name, type_ref.as_connection.name, via: via, dir: dir, referenced_field_name: references, foreign_key_type: foreign_key_type, cardinality: :many, related_type: type, indexing_only: indexing_only) do |f| f.argument schema_def_state.schema_elements.filter, type_ref.as_filter_input.name do |a| a.documentation "Used to filter the returned `#{field_name}` based on the provided criteria." end @@ -454,7 +462,7 @@ def relates_to_many(field_name, type, via:, dir:, singular: nil, indexing_only: unless indexing_only aggregations_name = schema_def_state.schema_elements.normalize_case("#{singular}_aggregations") - relates_to(aggregations_name, type_ref.as_aggregation.as_connection.name, via: via, dir: dir, foreign_key_type: foreign_key_type, cardinality: :many, related_type: type) do |f| + relates_to(aggregations_name, type_ref.as_aggregation.as_connection.name, via: via, dir: dir, referenced_field_name: references, foreign_key_type: foreign_key_type, cardinality: :many, related_type: type) do |f| f.argument schema_def_state.schema_elements.filter, type_ref.as_filter_input.name do |a| a.documentation "Used to filter the `#{type}` documents that get aggregated over based on the provided criteria." end @@ -567,14 +575,15 @@ def register_field(name, field, registry, registry_type, only_option_to_fix, &to registry[name] = field end - def relates_to(field_name, type, via:, dir:, foreign_key_type:, cardinality:, related_type:, indexing_only: false) + def relates_to(field_name, type, via:, dir:, referenced_field_name:, foreign_key_type:, cardinality:, related_type:, indexing_only: false) field(field_name, type, sortable: false, filterable: false, groupable: false, graphql_only: true, indexing_only: indexing_only) do |field| relationship = schema_def_state.factory.new_relationship( field, cardinality: cardinality, related_type: schema_def_state.type_ref(related_type).to_final_form, foreign_key: via, - direction: dir + direction: dir, + referenced_field_name: referenced_field_name ) field.relationship = relationship @@ -583,9 +592,9 @@ def relates_to(field_name, type, via:, dir:, foreign_key_type:, cardinality:, re yield relationship if block_given? if dir == :out - register_inferred_foreign_key_fields(from_type: [via, foreign_key_type], to_other: ["id", "ID!"], related_type: relationship.related_type) + register_inferred_foreign_key_fields(from_type: [via, foreign_key_type], to_other: [referenced_field_name, "ID!"], related_type: relationship.related_type) else - register_inferred_foreign_key_fields(from_type: ["id", "ID!"], to_other: [via, foreign_key_type], related_type: relationship.related_type) + register_inferred_foreign_key_fields(from_type: [referenced_field_name, "ID!"], to_other: [via, foreign_key_type], related_type: relationship.related_type) end if relationships_by_name.key?(field_name) diff --git a/elasticgraph-schema_definition/sig/elastic_graph/schema_definition/factory.rbs b/elasticgraph-schema_definition/sig/elastic_graph/schema_definition/factory.rbs index e40b2fa50..d4b08f8b3 100644 --- a/elasticgraph-schema_definition/sig/elastic_graph/schema_definition/factory.rbs +++ b/elasticgraph-schema_definition/sig/elastic_graph/schema_definition/factory.rbs @@ -112,7 +112,8 @@ module ElasticGraph cardinality: SchemaElements::Relationship::cardinality, related_type: SchemaElements::TypeReference, foreign_key: ::String, - direction: SchemaElements::foreignKeyDirection + direction: SchemaElements::foreignKeyDirection, + referenced_field_name: ::String ) -> SchemaElements::Relationship @@relationship_new: ::Method diff --git a/elasticgraph-schema_definition/sig/elastic_graph/schema_definition/indexing/relationship_resolver.rbs b/elasticgraph-schema_definition/sig/elastic_graph/schema_definition/indexing/relationship_resolver.rbs index ad8800f52..2f4c68884 100644 --- a/elasticgraph-schema_definition/sig/elastic_graph/schema_definition/indexing/relationship_resolver.rbs +++ b/elasticgraph-schema_definition/sig/elastic_graph/schema_definition/indexing/relationship_resolver.rbs @@ -23,6 +23,10 @@ module ElasticGraph indexableType, SchemaArtifacts::RuntimeMetadata::Relation ) -> ::String? + def validate_referenced_field: ( + indexableType, + SchemaArtifacts::RuntimeMetadata::Relation + ) -> ::String? def relationship_description: () -> ::String end diff --git a/elasticgraph-schema_definition/sig/elastic_graph/schema_definition/schema_elements/relationship.rbs b/elasticgraph-schema_definition/sig/elastic_graph/schema_definition/schema_elements/relationship.rbs index ee1d03122..301824047 100644 --- a/elasticgraph-schema_definition/sig/elastic_graph/schema_definition/schema_elements/relationship.rbs +++ b/elasticgraph-schema_definition/sig/elastic_graph/schema_definition/schema_elements/relationship.rbs @@ -14,6 +14,7 @@ module ElasticGraph @related_type: TypeReference @foreign_key: ::String @direction: foreignKeyDirection + @referenced_field_name: ::String @equivalent_field_paths_by_local_path: ::Hash[::String, ::String] @additional_filter: ::Hash[::String, untyped] @@ -22,7 +23,8 @@ module ElasticGraph cardinality: cardinality, related_type: TypeReference, foreign_key: ::String, - direction: foreignKeyDirection + direction: foreignKeyDirection, + referenced_field_name: ::String ) -> void def additional_filter: (::Hash[::String, untyped]) -> void diff --git a/elasticgraph-schema_definition/sig/elastic_graph/schema_definition/schema_elements/type_with_subfields.rbs b/elasticgraph-schema_definition/sig/elastic_graph/schema_definition/schema_elements/type_with_subfields.rbs index 9dc88ff72..8fa98c03f 100644 --- a/elasticgraph-schema_definition/sig/elastic_graph/schema_definition/schema_elements/type_with_subfields.rbs +++ b/elasticgraph-schema_definition/sig/elastic_graph/schema_definition/schema_elements/type_with_subfields.rbs @@ -78,8 +78,8 @@ module ElasticGraph ?highlightable: bool? ) ?{ (Field) -> void } -> Field - def relates_to_one: (::String, ::String, via: ::String, dir: foreignKeyDirection, ?indexing_only: bool) ?{ (Relationship) -> void } -> void - def relates_to_many: (::String, ::String, via: ::String, dir: foreignKeyDirection, ?singular: ::String?, ?indexing_only: bool) ?{ (Relationship) -> void } -> void + def relates_to_one: (::String, ::String, via: ::String, dir: foreignKeyDirection, ?references: ::String, ?indexing_only: bool) ?{ (Relationship) -> void } -> void + def relates_to_many: (::String, ::String, via: ::String, dir: foreignKeyDirection, ?references: ::String, ?singular: ::String?, ?indexing_only: bool) ?{ (Relationship) -> void } -> void def generate_sdl: (name_section: ::String) ?{ (Field::argument) -> boolish } -> String def current_sources: () -> ::Array[::String] @@ -106,6 +106,7 @@ module ElasticGraph ::String, via: ::String, dir: foreignKeyDirection, + referenced_field_name: ::String, foreign_key_type: ::String, cardinality: Relationship::cardinality, related_type: ::String, diff --git a/elasticgraph-schema_definition/spec/unit/elastic_graph/schema_definition/runtime_metadata/object_types_by_name/relation_metadata_spec.rb b/elasticgraph-schema_definition/spec/unit/elastic_graph/schema_definition/runtime_metadata/object_types_by_name/relation_metadata_spec.rb index fff3e54ae..d824162d1 100644 --- a/elasticgraph-schema_definition/spec/unit/elastic_graph/schema_definition/runtime_metadata/object_types_by_name/relation_metadata_spec.rb +++ b/elasticgraph-schema_definition/spec/unit/elastic_graph/schema_definition/runtime_metadata/object_types_by_name/relation_metadata_spec.rb @@ -29,6 +29,7 @@ module SchemaDefinition relation: SchemaArtifacts::RuntimeMetadata::Relation.new( foreign_key: "parent_id", direction: :out, + referenced_field_name: "id", additional_filter: {}, foreign_key_nested_paths: [] ) @@ -50,6 +51,7 @@ module SchemaDefinition relation: SchemaArtifacts::RuntimeMetadata::Relation.new( foreign_key: "parent_id", direction: :in, + referenced_field_name: "id", additional_filter: {}, foreign_key_nested_paths: [] ) @@ -85,6 +87,7 @@ module SchemaDefinition relation: SchemaArtifacts::RuntimeMetadata::Relation.new( foreign_key: "parent_id", direction: :in, + referenced_field_name: "id", additional_filter: filter, foreign_key_nested_paths: [] ) @@ -121,6 +124,7 @@ module SchemaDefinition relation: SchemaArtifacts::RuntimeMetadata::Relation.new( foreign_key: "parent_id", direction: :in, + referenced_field_name: "id", additional_filter: {"is_enabled" => {"equal_to_any_of" => [true]}}, foreign_key_nested_paths: [] ) @@ -166,6 +170,7 @@ module SchemaDefinition relation: SchemaArtifacts::RuntimeMetadata::Relation.new( foreign_key: "parent_id", direction: :in, + referenced_field_name: "id", additional_filter: { "is_enabled" => {"equal_to_any_of" => [true]}, "details" => {"foo" => {"lt" => 3}, "bar" => {"gt" => 5}}, @@ -247,6 +252,7 @@ def test_foreign_key_nested_paths(type_definition_order) relation: SchemaArtifacts::RuntimeMetadata::Relation.new( foreign_key: "players.affiliations.sponsorships.sponsor_id", direction: :in, + referenced_field_name: "id", additional_filter: {}, foreign_key_nested_paths: ["players", "players.affiliations.sponsorships"] ) diff --git a/elasticgraph-schema_definition/spec/unit/elastic_graph/schema_definition/runtime_metadata/object_types_by_name/update_targets_spec.rb b/elasticgraph-schema_definition/spec/unit/elastic_graph/schema_definition/runtime_metadata/object_types_by_name/update_targets_spec.rb index f5572f586..a65eb92ad 100644 --- a/elasticgraph-schema_definition/spec/unit/elastic_graph/schema_definition/runtime_metadata/object_types_by_name/update_targets_spec.rb +++ b/elasticgraph-schema_definition/spec/unit/elastic_graph/schema_definition/runtime_metadata/object_types_by_name/update_targets_spec.rb @@ -861,6 +861,32 @@ def expect_widget_update_target_with( }.not_to raise_error end + it "raises an error if an outbound references field does not exist on the related type" do + expect { + update_targets_for("Widget", on_widget_workspace_type: ->(t) { + t.relates_to_one "widget", "Widget", via: "widget_id", dir: :out, references: "guid" + }) + }.to raise_error Errors::SchemaError, a_string_including( + "`WidgetWorkspace.widget` uses `Widget.guid` as the `references` field, but that field does not exist as an indexing field." + ) + end + + it "raises an error if a custom references field (not 'id') is used on an indexed type, since references can only be customized for embedded types" do + expect { + update_targets_for("Widget", on_widget_workspace_type: ->(t) { + t.field "guid", "ID" + }) do |t| + t.relates_to_one "workspace", "WidgetWorkspace", via: "workspace_id", dir: :out, references: "guid" + + t.field "workspace_name", "String" do |f| + f.sourced_from "workspace", "name" + end + end + }.to raise_error Errors::SchemaError, a_string_including( + "uses `references: \"guid\"` on indexed type `WidgetWorkspace`, but the `references` parameter can only be customized for relationships to embedded types" + ) + end + it "allows a foreign key whose type is nested inside of an `object` array" do expect { object_type_metadata_for "WidgetWorkspace" do |s| diff --git a/spec_support/lib/elastic_graph/spec_support/factories/widgets.rb b/spec_support/lib/elastic_graph/spec_support/factories/widgets.rb index df0b6f379..3600efa33 100644 --- a/spec_support/lib/elastic_graph/spec_support/factories/widgets.rb +++ b/spec_support/lib/elastic_graph/spec_support/factories/widgets.rb @@ -89,6 +89,33 @@ created_at { Faker::Time.between(from: recent_date - 30, to: recent_date).utc.iso8601 } end + factory :widget_inspection, parent: :hash_base do + __typename { "WidgetInspection" } + guid { Faker::Alphanumeric.alpha(number: 20) } + end + + factory :inspection_summary, parent: :indexed_type do + __typename { "InspectionSummary" } + widget_inspection_guid { widget_inspection&.fetch(:guid) } + summary { Faker::Lorem.sentence } + created_at { Faker::Time.between(from: recent_date - 30, to: recent_date).utc.iso8601 } + + transient do + widget_inspection { nil } + end + end + + factory :inspection_note, parent: :indexed_type do + __typename { "InspectionNote" } + widget_inspection_guid { widget_inspection&.fetch(:guid) } + note { Faker::Lorem.sentence } + created_at { Faker::Time.between(from: recent_date - 30, to: recent_date).utc.iso8601 } + + transient do + widget_inspection { nil } + end + end + factory :widget, parent: :indexed_type do __typename { "Widget" } workspace_id { Faker::Alphanumeric.alpha(number: 6) } @@ -113,6 +140,7 @@ the_options { options } internal_details { build :widget_internal_details } internal_highlightable_details { build :widget_internal_details } + inspection { build :widget_inspection } component_ids do components.map { |c| c.fetch(:id) } diff --git a/spec_support/lib/elastic_graph/spec_support/runtime_metadata_support.rb b/spec_support/lib/elastic_graph/spec_support/runtime_metadata_support.rb index 29316874b..3db4b69f4 100644 --- a/spec_support/lib/elastic_graph/spec_support/runtime_metadata_support.rb +++ b/spec_support/lib/elastic_graph/spec_support/runtime_metadata_support.rb @@ -152,8 +152,8 @@ def sort_field_with(field_path: "path.to.some.field", direction: :asc) ) end - def relation_with(foreign_key: "some_id", direction: :asc, additional_filter: {}, foreign_key_nested_paths: []) - Relation.new(foreign_key: foreign_key, direction: direction, additional_filter: additional_filter, foreign_key_nested_paths: foreign_key_nested_paths) + def relation_with(foreign_key: "some_id", direction: :asc, referenced_field_name: "id", additional_filter: {}, foreign_key_nested_paths: []) + Relation.new(foreign_key: foreign_key, direction: direction, referenced_field_name: referenced_field_name, additional_filter: additional_filter, foreign_key_nested_paths: foreign_key_nested_paths) end def graphql_field_with(name_in_index: "name_index", relation: nil, computation_detail: nil, resolver: nil)