Hacker Newsnew | past | comments | ask | show | jobs | submit | akio's commentslogin

If all your experience comes from Apollo Client and Apollo Server, as the author's does, then your opinion is more about Apollo than it is about GraphQL.

You should be using Relay[0] or Isograph[1] on the frontend, and Pothos[2] on the backend (if using Node), to truly experience the benefits of GraphQL.

[0]: https://relay.dev/

[1]: https://isograph.dev/

[2]: https://pothos-graphql.dev/


Incidentally, v0.5.0 of Isograph just came out! https://isograph.dev/blog/2025/12/14/isograph-0.5.0/ There are lots of DevEx wins in this release, such as the ability to create have an autofix create fields for you. (In Isograph, these would be client fields.)


There are also GraphQL interfaces for various databases which can be useful, especially with federation to tie them together into a supergraph.


GraphQL Yoga is also excellent (and you get the whole Guild ecosystem of plugins etc), if you want to go schema-first


Evan Siroky's Timezone Boundary Builder[0] is a good source of time zone boundary mappings. It can be used via a library in nearly any language you would want[1], or loaded directly into Postgres and used with PostGIS in queries[2] (of course, if you load it into your DB you should have a process for keeping it updated).

It would be wonderful if Jiff supported coordinates-to-tz lookups out of the box :)

[0]: https://github.com/evansiroky/timezone-boundary-builder/rele...

[1]: https://github.com/evansiroky/timezone-boundary-builder#look...

[2]: https://www.crunchydata.com/blog/timezone-transformation-usi...


I'm aware, yet it doesn't invalidate my point. You'll note that I didn't say it was impossible to do. You would also need to rely on this database being updated similar to the tzdb, which is another data dependency to consider. There is also the problem that there isn't an established interchange format for such things, but there is one for IANA time zone identifiers (RFC 9557).

Finally, the database you linked doesn't appear to track historical data, unlike the tzdb. So if Ukraine reacquired territory, you'd end up with a wrong answer if looking at appointments scheduled in the past.


Past events should just be stored as instants, not as a local time plus location or time zone.

Further, I believe the historical data is meant to be handled by the named time zone, so Russia moving Dnipro to MSK would create a new time zone, call it Europe/Dnipro, then Ukraine reacquiring the territory and moving it back to EET would keep (or further split) Europe/Dnipro, and the historical changes of Dnipro would be handled by tzdb.

So even if you did store past events with a local time plus a location (which you should not do), I don't think Ukraine reacquiring the territory would cause problems, although we're really stretching my knowledge of IANA named zones and I could certainly be wrong.


> Past events should just be stored as instants, not as a local time plus location or time zone.

Appointments become past events. Sounds like an operational nightmare to convert all of them right as they become past events.

And you absolutely want the time zone (and offset) if you want to show past event as a local time for where that event was held. You don't need the location because you know what time zone rules governed that location at that point in time in the past. It won't change.

Please consider that I phrased my comment in engineering terms. I already acknowledged that you want a physical location for the best results in all cases, as you have pointed out in this thread. But I also was careful to contextualize it in engineering terms: storing that information comes with extra engineering costs over just storing an RFC 9557 string. Sometimes those costs are worth it, but certainly not for every use case.

> Further, I believe the historical data is meant to be handled by the named time zone, so Russia moving Dnipro to MSK would create a new time zone, call it Europe/Dnipro, then Ukraine reacquiring the territory and moving it back to EET would keep (or further split) Europe/Dnipro, and the historical changes of Dnipro would be handled by tzdb.

I can believe that this is what would happen.


> Appointments become past events. Sounds like an operational nightmare to convert all of them right as they become past events.

That is fair. In some models there's a natural separation between a scheduled-at time and a happened-at time (e.g., in one I worked on scheduled_events was a separate table from past_events), but I accept that's certainly not all, or even most. I shouldn't have made such a blanket statement. I do believe the statement is good advice in cases where your data does not mix both future and past times.

> Sometimes those costs are worth it, but certainly not for every use case.

This is also fair. My experience with time zones has been the more correct I can make my time models, the better I sleep at night, but of course you're right engineering involves tradeoffs. I think it's important to at least know the most correct way so that you are making educated decisions in your tradeoffs.

Also, FWIW I'm not the person you originally replied to, although the Ukraine example was mine.


That is not quite right. In Postgres, timestamptz (aka timestamp with time zone) represents an instant in time. timestamp (aka timestamp without time zone) represents what you are calling local time. timestamp (without time zone) is exactly what you should use to store future appointments.

Something that often trips people up is that they think timestamptz stores a timestamp plus a time zone (probably because of its unfortunate name). It does not; it always stores a Unix epoch without an extra time zone, converting any zoned timestamp that it is passed.


Yes, you are right.


You are wrong, and fauigerzigerk is correct.

Future physical events, such as an appointment at a physical location, should be stored as unzoned time plus a location (such as an address), NOT with a named time zone.

This is because physical locations can change named time zones due to political reasons (this has happened many times already).

Storing an appointment time with “Europe/London” only works if your appointment is actually in London and not some other British city (and even that assumes that London never gets divided in the future).

If I say meet me in person at 10am March 5th, 2030 in Dnipro, Ukraine, that's specific to a location, not Europe/Kyiv.

Why? Because perhaps in 2030 Russia has taken over Dnipro and moved it from Europe/Kyiv to Europe/Moscow.

Our meeting time has obviously not changed, but its exact instant on the universal timeline has changed.

This is super important to get right and you are spreading incorrect information that, if followed, will lead to bugs.


If you're going to go to those lengths you will need a way to map the geographical location to a time convention (and you'll probably need something better than an address for the location as those can change too). I don't dispute there are use cases where that may be required, and it's not what I'm advising against.

What I'm explaining is that it's usually wrong to store a nominal (date)time that can't be resolved to an instant in time without assuming extra information that isn't captured.

If fauigerzigerk isn't arguing in favour of doing that, and I've misunderstood the prior discussion, then great. The point should be made anyway, because people doing that is by far the biggest cause of time-related software issues in my extensive experience.


A future appointment at a physical location is usually an agreement between two or more humans. Humans generally don’t use UTC for future physical events, nor they use a time in a named time zone. What they use is a local time and location (often an address).

fauigerzigerk is saying that this, among with others, is the use case for what they are calling “local time,” what you are calling “nominal time,” what Postgres calls “timestamp without time zone,” and what the JS Temporal API calls “ PlainDateTime.”

In my experience engineers not understanding this key point, and believing that zoned time should be used for everything, is its own cause of issues and confusion.


You are technically correct but I’m not convinced it is “super important”. The stakes of not messing up appointment times in the very rare edge case of a territory changing time zones seems pretty low. I’m willing to be convinced that I’m wrong, though.


It is not as rare as you might think.

The most recent time this happened was March of this year, with Chile's Aysén Region dropping DST and moving to the newly created America/Coyhaique.

https://data.iana.org/time-zones/tzdb/NEWS

I used to manage a large application for scheduling shifts at warehouses in many different locations, and storing future events as local timestamps and lazily converting them just before calculations into their location’s zoned time was the only way I could stay sane.


I didn’t mean it’s globally rare, i.e. rare that it happens anywhere. I meant that it’s a rare thing for any given person to experience.

Even for people who live in Aysén, it will probably only happen once in their lives, and the only impact will be a few appointments getting messed up. Is having to fix a few calendar entries once in your life really “super important” to avoid?


The consequences could look something like 50 shift workers showing up an hour late one day, or a user missing a critical meeting.

Dealing with and debugging time zones is already such a confusing mess that I find that anything that makes your application more correct with regards to time zones is worth it. The important thing though is knowing, and then you can make an informed decision on how may shortcuts you want to take with time zones.

If you’re writing software that’s only designed to be used in a small region or by just a few people, then sure, it’s probably not super important.

If you’re writing software that’s used all over the map in places and time zones you can’t predict, well, it helps me sleep better at night.


Why didn't you store them as instants (offset from epoch) or UTC? Using local times, wouldn't your software produce different points in time for the same event when run with a different locale?


The events in question happen at a physical location at a local time, and so are stored as a local time plus longitude and latitude.

If they were stored as instants, and then if a location moved time zones or stopped using DST in the summer, the event’s stored time relative to the expected local time would incorrectly shift.


That's logically fine, although it strikes me as likely overkill since your system has to be able to look up a convention by lat/long in order to get an instant in time, which is not trivial to do and for most use cases would be a more frequent source of errors than changing timezone definitions. I don't know the details of your use case though, and this could well be the appropriate representation. The main thing is that enough information is present to identify an instant in time. Your scheme isn't the nominal-datetime-only representation that I pointed out is frequently used but rarely correct.


We agree that you generally want some information that lets you resolve your event to an IANA time zone for calculations :)


No. Local time should nearly always be used to represent the time of future physical events (along side a geographical location, such as an address).

Your method of using a named time zone like “Europe/London” is generally wrong for future physical events, and leads to bugs if and when the actual physical location of the event changes named time zones (which does happen).

If I say meet me in person at 10am March 5th, 2030 in Dnipro, Ukraine, that's specific to a location, not a named time zone.

Why? Because perhaps in 2030 Russia has taken over Dnipro and moved it from Europe/Kyiv to Europe/Moscow.

Our meeting time has obviously not changed, but its exact instant on the universal timeline has changed.

Physical future events are not a fixed instant on the universal timeline, they are a local time + a location.


> Why? Because perhaps in 2030 Russia has taken over Dnipro and moved it from Europe/Kyiv to Europe/Moscow.

Not that in invalidates your overall point, but in that case the TZ database would create a new timezone (eg. named Europe/Dnipro) to reflect that from 1996 to 2030 it was UTC+2/UTC+3 (with EU DST rules); then switched to UTC+3 only.

This reflects that there is a place whose rules changed on 2030. Places don't move to an other existing timezone because that would prevent reasoning about past datetimes.


Good point. As you mention, that doesn’t matter in this case, as even if a new named time zone is added, the stored named time zone would’ve been written before Europe/Dnipro was created (in case anyone’s wondering why this doesn’t invalidate the point).


How do the time databases handle location renaming (eg in 2030, Dnipro becomes Putinville?


Each record encodes optional FROM and TO fields: https://en.wikipedia.org/wiki/Tz_database


> Why? Because perhaps in 2030 Russia has taken over Dnipro and moved it from Europe/Kyiv to Europe/Moscow.

I think in this case Europe/Kyiv would actually change its UTC offset to match Europe/Moscow, which I'm pretty sure the TZ database would handle just fine.

> Our meeting time has obviously not changed, but its exact instant on the universal timeline has changed.

I think a sentence like this should jump out in big red letters. At face value it is not meaningful - how can our meeting time have not changed if the exact instant it occurs has changed?

If you chase this thought to its logical conclusion then it is not as obvious as you suggest. For instance, the number of hours between now and your proposed meeting has changed. Two meetings that happened to be simultaneous before now are no longer simultaneous because their relative UTC offsets changed. Is that a bug? What if your future physical event is the arrival of a train?

The choice in front of you is to pick a completely precise specification on which everyone agrees (the "instant of time") with an incomplete specification which you admit yourself may change in the future. My vote is to at least encode something unambiguous, and then to adjust it if my vague notion (local time) changes.


> how can our meeting time have not changed if the exact instant it occurs has changed?

Because human time is not a numeric offset, but a name of relevant points.

> The choice in front of you is to pick a completely precise specification on which everyone agrees (the "instant of time") with an incomplete specification which you admit yourself may change in the future. My vote is to at least encode something unambiguous

The incomplete ambiguous specification is the one everyone agrees to, programmers just don't like them.


> I think in this case Europe/Kyiv would actually change its UTC offset to match Europe/Moscow, which I'm pretty sure the TZ database would handle just fine.

Another user has already responded to the rest of your comment, so I’ll just respond to this.

In the Ukraine scenario Russia does not control Kyiv, so no, Europe/Kyiv would not change its offset.


The majority did not vote for Trump, and I question how many of the minority that did vote for him voted for this, specifically. Almost certainly not all of them, given his approval rating is now well below his popular vote share.


> So far as we have already formed engagements, let them be fulfilled with perfect good faith.

A key part.


We use Infisical for both our dev and prod environments. If you're a YC company you can get your first year free.

https://infisical.com


Chevron allowed massive regulatory changes whenever a new administration took over. At a time of high political polarization, no one should be asking that we defer to the whatever the current executive branch’s interpretation of the law is.

You may agree with the current President’s politics, but chances are you won’t agree with the next one’s.

https://www.yalejreg.com/nc/chevron-deference-vs-steady-admi...


That's more credible than the original point persnicker tried. And it's especially appropriate given the stated intention of the GOP to usher in an era where the entire bureaucracy of the federal government shifts to match the political ideology of the newly elected president. If that comes to pass, it will be an amazing back-and-forth switch every few years. Institutional inertia seems preferable in comparison.


> stated intention

Namely, Republican efforts to dramatically increase the scope of government employees that a president can appoint and fire on a whim. Basically a move towards the "spoils system" of rewarding political allies and donors with powerful or lucrative jobs.

https://www.citizensforethics.org/news/analysis/faq-the-cons...


It's fascinating to read the platform; there is the unspoken assumption that they will be installing all of these partisan bureaucrats that can keep on pushing their ideology even when their guy isn't president. As if it won't just be that each incoming president instantly fires every last one of them and then spends their entire term trying to fill those positions. Perhaps paralysis IS the point.


It's not as if judges are any more or less political. They're also not elected in most cases.

It's pretty easy for a company to pick a court district which will be favorable to them, regardless of the experts brought in.


You can specify parts of a query should be sent in subsequent responses with the @defer directive, and your client and server libraries will handle the rest for you.

Server side:

https://the-guild.dev/graphql/yoga-server/docs/features/defe...

https://www.apollographql.com/docs/router/executing-operatio...

Client side:

https://www.apollographql.com/docs/react/data/defer

https://relay.dev/docs/next/glossary/#defer


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: