typeql icon indicating copy to clipboard operation
typeql copied to clipboard

Add Quine trait to AST, make `pretty` public.

Open sevki opened this issue 4 months ago • 3 comments

Product change and motivation

  • feat:Make pretty public.
  • fix: Pretty now prints annotations.
  • fix: suppress some build warnings.
  • feat: add derive(Quine) to AST members.

Implementation

Adds an optional quine derive feature to the package that will implement Quine for the AST to make it possible for the ASTs to reproduce them selves.

sevki avatar Sep 18 '25 12:09 sevki

ha. the annotation fix is already in. didn't realize that.

sevki avatar Sep 18 '25 12:09 sevki

Sorry i've just had a lot come up! I need to chat with the team what we should do with these specialized implementations that are gated behind feature flags!

flyingsilverfin avatar Oct 06 '25 14:10 flyingsilverfin

Hey @flyingsilverfin no worries. I got a bit stuck with this entire ordeal too due to macro site hygiene issues and haven't been able to figure out how to mix schemas and queries.

I was thinking about two approaches, both with their own downsides.

  1. Only use define and have users define their queries up front, this works really well in terms of type inference but you lose dynamic typing of queries which isn't ideal.
  2. Use both where we define a schema upfront and dynamic queries but we loose some type safety from dynamically shaped queries.

Ideally I would love to have a solution that combines both but I'm not there yet. I'll keep you updated with more information as I keep working on this.

Already responding to this has helped me figure some things out 😄

Hope you have a wonderful week

sevki avatar Oct 06 '25 14:10 sevki