!DnCCJuwYmWbWvqiELC:matrix.org

dev-db

1010 Members
4 Servers

Load older messages


SenderMessageTime
28 Nov 2023
@_discord_805968375305469992:t2bot.ioAndy | Source Edit: We can still auto create them if omitted by the user 19:59:35
@_discord_949770387531636757:t2bot.ioFred | Source That is just a normal join 20:00:05
@_discord_281980464380772352:t2bot.ioJohn | Source I think this is a nice approach given the constraints of the GQL spec, technically you need to redefine the fields on the implements type that inherits from the interface. 20:00:48
@_discord_949770387531636757:t2bot.ioFred | Source That's what I don't like about it. 20:01:43
@_discord_281980464380772352:t2bot.ioJohn | Source Yes, and we implement it as a type-join, but the problem is that with GQL strong typing, if you want to query something it must be defined, so you need to define both sides of the relationship on the SDL types 20:01:45
@_discord_281980464380772352:t2bot.ioJohn | Source I want to highlight technically, cus we can kinda do w.e we want without entirely breaking spec 20:02:08
@_discord_805968375305469992:t2bot.ioAndy | Source Was about to write/laugh at the italics there 😄 20:02:34
@_discord_281980464380772352:t2bot.ioJohn | Source eg
interface User {
  name: String
}

type Friend implements User {}
20:02:46
@_discord_281980464380772352:t2bot.ioJohn | Source if we used exactly that (open for debate, theres pros and cons) then our system can autofill the implements side of the type 20:03:09
@_discord_281980464380772352:t2bot.ioJohn | Source or we can just use directives 20:03:52
@_discord_805968375305469992:t2bot.ioAndy | Source Yeah, I'd be very tempted by that, especially given how we already auto-create a bunch of fields any way (id, relation ids, maybe secondary halves of a relation, etc) 20:04:08
@_discord_805968375305469992:t2bot.ioAndy | Source * Yeah, I'd be very tempted by that, especially given how we already auto-create a bunch of fields anyway (id, relation ids, maybe secondary halves of a relation, etc) 20:04:26
@_discord_949770387531636757:t2bot.ioFred | Source Except if we follow the specs exactly. But like John said, we don't have to be exact. 20:06:24
@_discord_281980464380772352:t2bot.ioJohn | Source note, we would have to automatically create the User type anyway here too, for the introspection stuff.

So the interface User {} would get converted to a type User anyway, just in a way that won't create a cooresponding collection
20:06:26
@_discord_805968375305469992:t2bot.ioAndy | Source I'm coding something very similar to this atm for views anyway, as I need to define read-only GQL types - so far there seems to be very little work involved, although that is without the compilation of dealing with interface vs type 20:08:43
@_discord_281980464380772352:t2bot.ioJohn | Source it walks the line of breaking the spec, but only if ppl want to use their written SDL definitions with other GQL tooling, If however, they regenerate the SDL after it gets processed by our system from the introspection endpoint, then the resulting SDL can be 100% spec compliant 20:09:32
@_discord_805968375305469992:t2bot.ioAndy | Source
If however, they regenerate the SDL after it gets processed by our system from the introspection endpoint, then the resulting SDL can be 100% spec compliant
This is a nice thing to highlight 🙂
20:10:11
@_discord_805968375305469992:t2bot.ioAndy | Source I think users should also be free to write spec compliant SDLs, and include the auto-generated stuff explicitly if they want 20:11:29
@_discord_281980464380772352:t2bot.ioJohn | Source side note, will create a thread talking about Keenans specific question regarding embedding, which although related, can be discussed independantly to this overall design/modeling convo 20:11:54
@_discord_805968375305469992:t2bot.ioAndy | Source * I think users should also be free to write spec compliant SDLs, and include the auto-generated stuff explicitly if they want, e.g.:
type Friend implements User {
  name String
}
20:12:02
@_discord_281980464380772352:t2bot.ioJohn | Source Object Embedding 20:12:17
@_discord_805968375305469992:t2bot.ioAndy | Source * I think users should also be free to write spec compliant SDLs, and include the auto-generated stuff explicitly if they want, e.g.:
type Friend implements User {
  id DocKey
  name String
}
20:13:12
@_discord_949770387531636757:t2bot.ioFred | Source What is a users does this?
type Friend implements User {
  id: DocKey
  name: String
  favouriteSoup: String // not part of User
}
20:14:44
@_discord_805968375305469992:t2bot.ioAndy | Source We don't have to allow that if we dont want to 20:15:04
@_discord_281980464380772352:t2bot.ioJohn | Source we can have our own independant validation 20:15:09
@_discord_281980464380772352:t2bot.ioJohn | Source in addition to the spec 20:15:33
@_discord_805968375305469992:t2bot.ioAndy | Source If we went this route, I would probably prefer @collections("friend", "boss"), but I do prefer the interface route even though it is a bit more verbose 20:24:46
@_discord_805968375305469992:t2bot.ioAndy | Source * If we went this route, I would probably prefer an array @collections("friend", "boss"), but I do prefer the interface route even though it is a bit more verbose 20:25:03
@_discord_949770387531636757:t2bot.ioFred | Source Using interface for what we want to do, to me, feels like Rust (annoyingly over decorated with it's syntax), while the suggestion by John feels like Go (as simple as it can be and no ambiguity) 😂 20:25:58
@_discord_949770387531636757:t2bot.ioFred | Source I'm exaggerating here but I do feel like the interface approach is a little too fancy 20:27:08

Show newer messages


Back to Room ListRoom Version: 9