Autumn '24 🍂 Status Update #1163
Replies: 3 comments
-
Oh, and make raw great: #1164 |
Beta Was this translation helpful? Give feedback.
-
It's been busy couple of weeks, made a lot of progress. Getting back to website work this week. |
Beta Was this translation helpful? Give feedback.
-
Work has been going well. I sent into a minor slump rewriting to/from mappers at type/term levels in order to bring extension and request pipeline feature parity between All of that is in my currently pinned issues if you're curious. |
Beta Was this translation helpful? Give feedback.
-
It is October now and I've been actively working on Graffle without an "official" update since summer so here's my most recent thoughts and plans.
Summer passed with a lot of progress on documentation and the extension system. Some highlights were:
Some setbacks were:
A few months ago I thought I was going to be able to release Graffle come September but I've since shifted my view on that. Here are my plans going forward:
Address all user issues as they come in, paper cuts and confusion or just bugs.
I want to keep the core very lean so that it can be a minimal GraphQL client solution suitable for bundling into a client. Achieving this means having a powerful extension system.
In the spirit of the above, make the runtime schema optional and small.
Graffle has achieved a few features by keeping a "runtime schema" but since the beginning I've been concerned about this due to the unbounded size of GraphQL schemas. For example, I want to have an auto-generated GraphQL client for the GitHub API
npm add @graffle/client-github
but it doesn't strike me as realistic to pitch "and keep a runtime representation of the whole GitHub GraphQL schema in your bundle too".Here's where the runtime schema is used.
Left
in anEither
type etc.).Currently those features are built into core which means that users have no option about their use. I want to change that. Both custom scalars and schema errors should become extensions. This is tricky because there is a build time generation step that those features depend on so I must now include the ability to extend the generator. I am actually excited about that though and think it's a great direction.
Once those features are extensions, it means users will only pay for the bundle cost of a runtime schema if they benefit from it. Furthermore I also am taking steps to reduce the runtime schema from a full representation to instead minimal subsets that only provide just enough information for the feature. I have already for example finished the generator for a custom scalars index that contains just paths to custom scalar locations (see example here).
Graffle and GraphQL (raw) interface symmetry.
For a while I was considering
raw
as an escape hatch that would not participate in features like custom scalars and schema errors. I have changed my mind about this as I've realized it's not a stretch to achieve symmetry. I also think its pretty confusing to keep track of the difference feature support between them. It's a much simpler story to just say for example that custom scalars are decoded and encoded with every request however you make it, full stop.Achieving this means doing document manipulation. If you send a raw string GraphQL document there will be some parse/print overhead but these will be opt-in, minimal overhead in most cases I expect (perhaps massive documents start to see more than single digit milliseconds cost?), and not present if you use other interfaces like sending a GraphQL document instances with raw or the Graffle interface.
CLI into own Package
I haven't fully figured this one out but I would like to extract the generator and CLI of into a new package that supports various points here about keeping a lean core. While the CLI should anyways be dropped via tree-shaking I think it still makes sense to keep
graffle
package apart from saygraffle-cli
. I may go the way of Prisma here havinggraffle
be a CLI and@graffle/client
be the core package. I'm curious to hear feedback about package naming. I still need to think this over more myself.New GitHub Organization
Finally a more meta thing. I've been offered some financial support to work on Graffle but part of meeting the criteria for that includes moving Graffle to an org that encourages more community involvement. To that end, I have decided to move this repo to https://github.com/graffle-js. Over time additional repos will be made for example for each first-party extension.
Alright, those are my major thoughts for now. So to recap:
Thanks for your attention and let me know what you think! Cheers
Beta Was this translation helpful? Give feedback.
All reactions