Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tailor DateTime scalar filter to the domain of time #484

Closed
jasonkuhrt opened this issue Oct 15, 2019 · 3 comments
Closed

Tailor DateTime scalar filter to the domain of time #484

jasonkuhrt opened this issue Oct 15, 2019 · 3 comments
Labels
scope/schema type/feat Add a new capability or enhance an existing one

Comments

@jasonkuhrt
Copy link
Member

Currently we have:

input DateTimeFilter {
  equals: DateTime
  gt: DateTime
  gte: DateTime
  in: [DateTime!]
  lt: DateTime
  lte: DateTime
  not: DateTime
  notIn: [DateTime!]
}

This just an IntFilter using DateTime scalar type. I think we should filter tailored to the domain of time.

@jasonkuhrt jasonkuhrt added type/feat Add a new capability or enhance an existing one scope/schema labels Oct 15, 2019
@jasonkuhrt jasonkuhrt added this to Backlog in Labs Team via automation Oct 15, 2019
@jasonkuhrt jasonkuhrt changed the title Revisit DateTime scalar filter Tailor DateTime scalar filter to the domain of time Oct 15, 2019
@jasonkuhrt
Copy link
Member Author

jasonkuhrt commented Oct 15, 2019

May be desirable to push upstream into Photon.

Proposal:

input DateTimeFilter {
  at: DateTime
  before: DateTime
  beforeOrAt: DateTime
  after: DateTime
  afterOrAt: DateTime
  within: [DateTime!]! # domain-friendly short hand for specifying a before & after
  notWithin: [DateTime!]!
}

Loses some power but for the domain of time seems fine and now its simpler + clearer.

CC @Weakky do you think this is a better default API for GQL clients?

I'm not sure, tbh

@Weakky
Copy link
Member

Weakky commented Oct 15, 2019

While I like it, I'm wondering whether the change is worth the lack of consistency with all other filter types (String/Int/Float/BooleanFilter)

@jasonkuhrt
Copy link
Member Author

Feels like something that should be possible via customization/naming strategy. We can reference this issue as a use-case/example when we tackle that. Not only does my example show name strategy change, but also actual field changes (some ones added, some ones removed).

Labs Team automation moved this from Backlog to Shipped Oct 15, 2019
@jasonkuhrt jasonkuhrt removed this from Shipped in Labs Team Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope/schema type/feat Add a new capability or enhance an existing one
Projects
None yet
Development

No branches or pull requests

2 participants