hasura / ndc-spec

NDC Specification and Reference Implementation
http://hasura.github.io/ndc-spec
20 stars 5 forks source link

add alias to PathElement predicate expression #84

Closed BenoitRanque closed 9 months ago

BenoitRanque commented 9 months ago

We alias where expressions to predicate, in part because where is a reserved keyword in rust.

The PathElement does not follow this pattern. We should make the behavior consistent. For now I've only commited the change to add the missing alias. Do note this means a change in the expected payload, so we'll need to update schemas and tests too.

Before I do that, I'd like us to consider 3 different approaches and make a descision:

  1. Preserve the status quo, making things consistent. The expected json key would be where, and for rust the key is alliased to predicate
  2. Change all rust keys to r#where. This is the standard way to get around reserved keywords, and would make it clear from the struct keys what the expected IR looks like. The IR would still expect the keys to be where
  3. Change all keys to be predicate, in both the rust SDK and the IR. This is the most disruptive.

I'm ambivalent about either option 2 or 3, but dislike option 1.

paf31 commented 9 months ago

Looks good, thanks, but can you please fix the tests, and then I'll merge this with the upcoming set of breaking changes.