Skip to content

Support field functions #2037

@JimmyCheng

Description

@JimmyCheng

In SQL language, we can apply simple functions to the fields, including create new fields.
e.g.

SELECT concat(first_name, ' ' , last_name) AS full_name
SELECT A, B, 'c' as C from MyTable
SELECT ROUND(Weight_kg / (Height_m * Height_m), 2) AS BMI from ...

In DGraphQL, is it possible to support following kind of query?

{
 allNodes(func: eq(type, "DP")){
     supplyDate
     consumeDate
     status
     issueBehindSchedule: math(supply_date > consume_date)
     noSupplyDate: eq(supplyDate, null)
     atRisk: eq(status, "At Risk")
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/querylangIssues related to the query language specification and implementation.exp/expertDeeply technical issue not recommended to beginners.kind/featureSomething completely new we should consider.priority/P3Low priority, something to be done once everything else seems fixed.status/acceptedWe accept to investigate/work on it.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions