hasura / graphql-data-specification

A specification for Data APIs with GraphQL
https://hasura.github.io/graphql-data-specification/
18 stars 3 forks source link

Allow usage of functions in predicate expressions #16

Open coco98 opened 1 year ago

coco98 commented 1 year ago

We should extend the predicate function grammar to allow application of functions and not just : : style expressions.

This will allow the predicate expressions to capture more complex use-cases.

// Custom type validation (check if email is valid)
isValid(node.email): true

Possible syntax that works well when represented in a JSON DSL:

apply:
  functionName: isValid
  arguments: [node.email]