Skip to content

Add graphql forward function #10

@VGSML

Description

@VGSML

Add graphql forward function to support forward GraphQL query as is or with transform to original names to a separate service (http source) or by endpoint.
The main goal - run graphql on the separate GraphQL service.

For begin - implement forwarding GraphQL query to the cluster management node and return results from each node, something like this:

original query:

query($var1: Type1!, $var2:Type2){
  core{
    cluster{
      query_nodes{
        node
        query{
          devices(filter:$var1){
            id
            name
            description
            geom
            events(filter:{
              event_time: {
                gt: "2025-04-01T17:25"
                lte: "2025-04-01T17:25"
              }
              type: {
                eq: $var2
              }
            })
          }
        }
      }
    }
  }
}

forwarded query:

query($var1:OriginalType!, $var2: String){
  query_nodes{
    node
    query{
      devices_original_name(filter:$var1){
        id
        name
        description
        geom
        events(filter:{
          event_time: {
            gt: "2025-04-01T17:25"
            lte: "2025-04-01T17:25"
          }
          type: {
            eq: $var2
          }
        })
      }
    }
  }
}

This can be implemented as special SQL UDF - forward_graphql and should be defined a special query type (the same way as function or select), and special plan node, that serialises selection set as query and variables to JSON, and perform http call.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions