Description:
Adds initial support for Expr expressions via GraphQL under the univ-keys experimental flag.
exprToCondition will parse simplified Expr expressions into a structured condition with clauses
conditionToExpr will convert the Condition structure back into an Expr expression
Describe any introduced API changes:
extend type Query {
expr: Expr! @experimental(flagName: "univ-keys")
}
"""
Expr contains helpers for working with Expr expressions.
"""
type Expr {
"""
exprToCondition converts an Expr expression to a Condition.
"""
exprToCondition(input: ExprToConditionInput!): Condition!
@goField(forceResolver: true)
"""
conditionToExpr converts a Condition to an Expr expression.
"""
conditionToExpr(input: ConditionToExprInput!): String!
@goField(forceResolver: true)
}
Additional Info:
To test, use make start EXPERIMENTAL=univ-keys
Example GraphQL Query for Explorer
```graphql
query {
expr {
exprToCondition(input:{expr: "foo == \"bar\" and bin != 'baz' and baz in ['asdf','basfd']"}) {
clauses {
field
operator
value
}
}
conditionToExpr(input: {
condition: {
clauses: [
{
field: "foo",
operator: "contains",
value: "\"bar\""
},
{
field: "foo",
operator: "in",
value: "[\"bar\"]"
},
{
field: "bin",
operator: "!=",
value: "\"baz\""
}
]}
})
}
}
```
Description: Adds initial support for Expr expressions via GraphQL under the
univ-keys
experimental flag.exprToCondition
will parse simplified Expr expressions into a structured condition with clausesconditionToExpr
will convert the Condition structure back into an Expr expressionDescribe any introduced API changes:
Additional Info: To test, use
make start EXPERIMENTAL=univ-keys
Example GraphQL Query for Explorer
```graphql query { expr { exprToCondition(input:{expr: "foo == \"bar\" and bin != 'baz' and baz in ['asdf','basfd']"}) { clauses { field operator value } } conditionToExpr(input: { condition: { clauses: [ { field: "foo", operator: "contains", value: "\"bar\"" }, { field: "foo", operator: "in", value: "[\"bar\"]" }, { field: "bin", operator: "!=", value: "\"baz\"" } ]} }) } } ```