@pyrons_@colinhacks There's already a WIP plugin for this here: https://t.co/9mTOMYJtki
It's got a ways to go, and I had a few open questions I wanted to run by folks like @colinhacks before finalizing the API, but this is exactly what I've been waiting for to replace the old zod plugin
@andrewingram The only issue I could see with this is that if you apply the stream directive to the edges without deferring pageInfo you would have a handling promise for pageInfo
@andrewingram I think it should be possible to update the connection types to allow returning an async iterator of nodes. That way the normal connection resolver just returns the nodes, and the edges can be streamed, with page info only resolving once the iteration of edges completes
@andrewingram I'd be curious to see how that works. I wasn't able to find any documentation on the server side pieces of stream_connection, so I'm not sure what exactly is needed and if we can simplify it on the Pothos side
@andrewingram As you mentioned elsewhere, streaming the edges doesn't help the server unless you can also defer pageInfo which often requires loading the full page anyways.
My takeaway was that steam is mostly useful for deferring nested loads, and reducing the initial payload size
@andrewingram I'm not sure if that will change anything. Last time I looked into steam I thought that the server implementation would handle streaming responses even if the data in the resolver was provided as an array
@_philpl@VanTanev@mattpocockuk I'd definitely be excited to see more example projects using Pothos, so if you go down that route I'm always around to help out or answer any questions!
@SaukkonenVille@JoviDeC I think what most people want is: metrics about a response as a whole (time, number of fields, complexity) + timing metrics for specific fields with async resolvers
@SaukkonenVille@JoviDeC This plugin is more about creating a good base to implement something specific to your needs than a general solution. The core issue it is trying to solve is that most existing solutions wrap every resolver, which results in unacceptable performance overhead
@code_punkt@pothos_graphql Not something I've looked into much. I think it would be simple for someone to write a utility that builds a Pothos input types from a zod schema. Building output types doesn't really make as much sense.
Building with zod doesn't offer enough control for a core feature though
@givadesu@alexxubyte From what I was told, it was used for the partner API but no idea where that would fit in this diagram. It's impossible to fit everything you use at a company the size of Netflix into one neat infographic
@Mo_Sattler @kettanaito@pothos_graphql Yeah, I like the idea, but besides @TheGuildDev no body is sponsoring even close to that level, and they were sponsoring me before I added that.
If you have written or used custom Pothos plugins, reply here or dm me! There are some big internal changes coming in 4.0, and we are trying to figure out what internals people might be using to make the upgrade as easy as possible.
@trashh_dev@typescript@pothos_graphql Yeah, introducing new functions/arguments/generics is the only way I've found to make it work. I think your solution is about as good as I've come up with ๐ฟ I think this is the relevant ts issue: https://t.co/4wKeRtc53o
@trashh_dev@typescript@pothos_graphql splitting things into separate arguments works, and I think you can achieve something similar if you use arrays instead of objects, but I haven't found a good solution that lets TS build this exact API
@trashh_dev@typescript@pothos_graphql I was probably a little too vague there, and not sure if I can explain it better in a tweet, but when inferring the arguments, the return type can't be "inferred" (for the input arg generic) even when it's explicitly annotated in the fn definition. I don't know of a good fix