Skip to content

New GraphQL APIs - things to fix #3217

@t2gran

Description

@t2gran

Here is a list of things we should fix in the future version of the Transmodel API

General

  • Consider wrapping arrays in response to be extendable
  • Return general Shape, not specific types like Polygon
  • Design for "limiting" queries (>10Mb seen in travel search) See Harden web server securety #5037
  • Paging, connections and nodes
  • Framework support for sorting/filtering on lists

Routing request

  • Support for multi access/egress modes requests (today OTP2 only support explicit modes)
  • Consider using minTransferTime, not transferSlack like OTP1. board-/alightSlack should be tuning parameters?
  • Support of maxNumTransfers like OTP1. This is a pareto criteria; Hence is algorithmically ok to use. The current Raptor aditionalNumTransfers is difficult to understand and communicate - should be removed.
  • Global IDs (Apollo-caching). EstimatedCall.id

Types

  • Duration Consider using ISO-8601 format PnDTnHnMn

Dated Service Journey (DSJ)

  • Replace ServiceJourney in Trip(Leg) with DSJ

Bike Rental

  • Bike rental station coordinates should NOT be optional
  • Available number of bikes can be unknown (null)
  • Differentiate between stations and free-floating bicycles
  • Add GBFS form factors

Legs

  • Make separate types for the various legs: walking leg, transit leg, rental leg, car hailing leg, transfer leg, ...

Places

  • Quay.stopPlace can NOT be null. Enforce none null for all child to parent relations.
  • Should we list modes/submodes for patterns visiting, not using the station/stop fields?
  • Make separate types for Stations and Stops
    • Make Stop an interface since there are a number of implementations: RegularStop, AreaStop, GroupStop...

Real time

  • Better support for missing references from Alert to entities
  • Alerts on legs

Filter design

Something like
input SelectPattern {
 mode : Mode
 subMode : String
 agency : ID
 route : ID
 trip : ID
 not : SelectPattern
 and : [SelectPattern!]
 or : [SelectPattern!]
}

Example:

list(
  select : {
    mode : BUS
    and: [
      { subMode : "localBus" }
      {
        or: [
          { agency : "XYZ" }
          { agency : "ABC" }
    ] } ]
    not: { route: "B12" }
  }
) { ... }

References

  1. Production Ready Graphql by Marc-Andre Giroux.
  2. https://medium.com/workflowgen/graphql-query-timeout-and-complexity-management-fab4d7315d8d

Metadata

Metadata

Assignees

No one assigned

    Labels

    !ImprovementA functional improvement or micro feature+RoadmapCreate an issue and mention your organization in the title and tag with RoadMap to share your plan+SandboxThis will be implemented as a Sandbox featureEnturOn Entur RoadmapNew GraphQL APILabel issues we should consider when making a new GraphQL API for OTP2.StaleThis issue is stale, no activity for 90 days. Remove stale label or comment within 30 days.

    Type

    No type

    Projects

    Status

    < 12 months

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions