Graphlink generated a 400Mb source file!

Amazing graphlink written in dart for flutter developers enabling us graphql code generation with subscriptions+ cache handling included.

reddit.com
u/Impossible-Acadia987 — 4 days ago
▲ 0 r/Kotlin

Graphlink generated a 400Mb source file!

Graphlink added support to kotlin. You only need to write pure graphql queries and graphlink will marginally spit out a fully typed null safe graphql client. Not only that but it also supports subscriptions with zero Kotlin code.

Graphlink(config file, graphql files) = Fully typed null safe graphql client with subscriptions and cache.

The cache is not something you need to configure, graphlink generates the cache handling code for you with zero dependency.

Version 5 is coming soon and it added amazing features and stability.

See you soon.

reddit.com
u/Impossible-Acadia987 — 4 days ago

Graphlink generated a 400Mb source file!

After testing on Gitlab's huge full of unions schema and after fixing a lot of problems related to _all_fields fragment generation, graphlink was able to generate the client with more than 0.5 Gib of size.

This is obviously not something to brag about because no compiler is willing to help you compile that.i went through a lot of optimisation and found out some generated fragments are just huge.

I took a decision to add a configuration where a developer can set the max size for several reasons. The two most compelling ones are:

1- java has a limit for const strings which will generate a code that doesn't compiler (even though there is a work around to that.

2- Bandwidth and client size for typescript. None want to ship a huge client on a web app and none wants to send megabytes worth of data over the network for sending one request to a backend.

This being said I also encountered a lot of other issues that I fixed and guarded with tests. The hardest ones are java related because of its legacy.

Graphlink now can generate your full client just by writing pure graphql for 4 languages: Dart/Flutter Typescript Java and Kotlin.

I am planning to support other languages such as swift and maybe python (why not) in the future.

I am about to release version 5 that has been stress-tested on many known judge schemas such as GitLab GitHub Microsoft and twitch.

I will keep you updated.

Graphlik.dev

Start me on GitHub and open issues if you find any.

Cheers,

reddit.com
u/Impossible-Acadia987 — 4 days ago
▲ 7 r/dartlang+1 crossposts

Update on graphlink

Someone has opened issues on graphlink

Https://github.com/oualitsen/graphlink

The funny thing is that he tried on gitlab schema schema and found some errors that are not supposed to be.

I was happy for the feedback and I fixed some issues but then I tired it against guthub's massive schema, I fixed some errors and found a memory leak when generating all_fields_TYPE fragments for grant schema full of interfaces and unions. Am not going into deeper into the details, but that was a real stress test.

​

Work is still on making graphlink one of the fastest compilers for graphql clients and server scaffolding.

​

The goal behind is making graphql affordable.

​

Developed with dart by a java developer and Dart makes it a real fun to work with.

​

Have you ever had similar issues with your amazing project?

​

​

u/Impossible-Acadia987 — 18 days ago
▲ 1 r/KotlinMultiplatform+1 crossposts

Graphql client for kotlin? Graphlink.dev is the answer.

I have checked a lot of graphql clients out there and none of them is doing what I needed. There are some good ones out there but they all need to be baby setting a little bit.

This is why I worked on graphlink.

Graphlik takes a completely different way of doing things.

Your input as developer is the schema files (where you can define your custom queries compound queries fragments...etc),

The output is of graphlink: a full graphql client for kotlin that respects the null safety and returns actual object instead of maps. You get type safety and null safety + schema driven cache.

It is internally a compiler (with real compiler technology lexer + parser) that translates your schema files to a graphql client.

In fact used in front for a large project, believe me I did not have to declare a Data class once, everything is generated and my work reduced to writing forms and displaying results.

Give it a try:

Site: https://graphlink.dev

GitHub: https://github.com/Oualitsen/graphlik

Cheers.

reddit.com
u/Impossible-Acadia987 — 22 days ago
▲ 0 r/Kotlin

Stop writing GraphQL boilerplate in Kotlin — GraphLink generates everything

​

Been using **GraphLink** lately and it's genuinely changed how I work with GraphQL in Kotlin.

You write a `.graphql` schema, run `glink`, and get back idiomatic `data class` types, coroutine-based `suspend` methods, `kotlinx.serialization`, and typed `Flow<T>` subscriptions with **auto-reconnect out of the box**.

Call site ends up looking like:

```kotlin

val v = client.queries.getVehicle("42").getVehicle

println("${v.brand} ${v.model}")

```

No casting. No raw maps. Compiler knows the type.

Bonus: caching is declared right in the schema with `@glCache` and `@glCacheInvalidate`. The generated client handles TTL and tag-based invalidation automatically — no cache layer to wire up yourself.

Zero runtime dependency. MIT licensed. Single binary CLI.

https://graphlink.dev

Anyone else tried it? Curious what stack you're using it with.

reddit.com
u/Impossible-Acadia987 — 23 days ago

Graphql in java?

You know how java graphql clients are.

I am a senior java developer with more than 10 years of writing code in java and other programming language.

The thing is, the more you know the philosophy of the language the easier it is to guess how its libraries will look like.

I once tested a graphql client and I mean come on!!! Everything needed to be verbose and manual. You should specify variables in a Map.

I decided it was enough so I created a tool, basically a compiler that reads your graphql schema files and convert them into a typed, null safe graphql client with subscriptions support (interfaces and unions also supported out of the box).

It supports customer queries subscriptions interfaces unions and generates the whole model in either classes and records with builder patten so you do not need to use Lombok.

Meet graphlink.dev a cli tool that generates full fat java graphql clients out if you schema files in milliseconds.

https://graphlink.dev

#graphql #java #compiler #graphlinkdev

reddit.com
u/Impossible-Acadia987 — 28 days ago
▲ 9 r/dartlang+2 crossposts

Graphql client for flutter?

Tested the markets graphql clients for flutter then I ended up creating my own.

You declare your schema files, you create a simple config file, you run glink (cli tool) you get: fully typed null safe graphql client.

It supports subscriptions custom queries and everything you can imagine with batteries included.

Read more on

https://pub.dev/packages/graphlink

https://graphlink.dev

Saves time bugs and tokens.

Hit the up button and star on GitHub for support.

#graphql #dart #flutter #graphlinkdev

u/Impossible-Acadia987 — 22 days ago