Generating clients is not a new concept. We'll explain briefly how client generated by WunderGraph are different. Our clients are not just wrappers around APIs. They are smart around Authorization, now how to login your Users, are able to fetch streams without additional dependencies and require no configuration in most cases.
Let's take a look at our client for React + Typescript as an example.
For dependency injection and global state we generate the Component WunderGraphProvider. You have to wrap your entire React Application with it.
As you can see it takes zero arguments in the default state. This is because it's generated from the configuration in the console. There's no setup of additional dependencies or transports for subscriptions.
Logging in a user
The generated client contains a complete Openid Connect client. Starting the flow to login a user is as simple as a single function call. All callbacks are handled for your.
The generated client is able to invoke Queries, Mutations and Subscriptions without additional configuration. For each persisted Operation we generate all the required Models for Typescript including hooks to invoke the Operation. All this makes fetching data a simple function call.
To make developing with WunderGraph a fluent experience we've built WunderGen, our code generator. WunderGen lets you watch for configuration changes to automatically re-generate your client.
Our generated clients make it super easy to Login your users and fetch data either synchronous or using subscriptions. You're freed up from setting up all these and can focus on what matters, building an amazing app for your users.