Skip to content

Query DAG: Single query (syntactically), multiple queries (in practice) #947

@rbalicki2

Description

@rbalicki2

There are several seemingly unrelated features that can be solved with the same feature:

  • Supporting queries with selections from multiple backends ({ sql_foo graphql_bar }), which compiles into multiple queries
  • The ability to "jump" to the root, e.g. (field User.DisplayName { __root { viewer { name } } name }, e.g. to distinguish between "this user is the viewer" and vice versa), which also compiles into multiple queries (at least if the path to the User includes a nullable field)
  • The ability to thread results from one field to another, e.g. (with made-up syntax) { viewer { height @name(variableName: "height") } jealousOf: usersTallerThan(height: $height) { name } }, which also compiles into multiple queries (in GraphQL)
  • Perhaps, @loadable fields (which are a simple version of the above.)

The common feature is that these appear to be a single query (syntactically), but compile into a DAG of queries.

Metadata

Metadata

Assignees

No one assigned

    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