We would like to allow looking up items i.e., request a single item or nothing (in contrast to searching) by external identifiers. In case multiple items match the property + external ID pair, a conflict object is returned containing only the matching Item IDs.
Acceptance criteria:
- The field name would be "itemByExternalId" and would take the external id and its corresponding property id as input
Schema:
type Query {
# ...
itemByExternalId(property: PropertyId!, externalId: String!): ItemByExternalIdResult
}
union ItemByExternalIdResult = Item | ExternalIdNonUnique
type ExternalIdNonUnique {
items: [ItemId!]!
}Task breakdown notes:
- create a separate use case that performs the lookup
- the lookup resolver will call the ItemResolver
Open questions for Product:
- How complex is this lookup? (i.e. how many lookups are allowed in a single query?)