Skip to content

Restrict filter combinations for the serviceJourneys query in the TransModel API #6545

Open
@vpaturet

Description

@vpaturet

The following query returns a large number of results:

{
  serviceJourneys(
    lines: [],
    activeDates: "2025-03-17"
  ) {
    id
    line {
      publicCode
      presentation {
        colour
      }
    }
    estimatedCalls(
      date: "2025-03-17"
    ) {
      quay {
        name
      }
      aimedArrivalTime
      aimedDepartureTime
      expectedArrivalTime
      expectedDepartureTime
      actualArrivalTime
      actualDepartureTime
      destinationDisplay {
        frontText
      }
    }
  }
}

The same result is returned when using an empty string instead of an empty list:
lines: ""

The serviceJourneys query should be restricted so that:

  • empty list [] filters out all objects.
  • empty strings "" should be ignored (that is: treated as an empty list).
  • at least one filter should be non-null. That is: authorities or lines or privateCodes or activeDates should be non-null.

This is not sufficient to effectively limit the numbers of result for all possible filters combinations. A further step could be to make the activeDates filter mandatory.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions