Node.js / TypeScript support

The core language for WunderGraph users is TypeScript. The configuration of a WunderGraph application is written in TypeScript, you can write type-safe hooks in TS, and even the generated clients are written in TypeScript.

We believe that TypeScript is the number one language to reach a wide audience. TypeScript, compiled to JavaScript, is becoming the de-facto standard for web development.

With WunderGraph, you can manage the full stack of your application in TypeScript.

Here's the simplest example of using the generated TypeScript client in Node.js. Let's assume the following GraphQL mutation:

1
2
3
4
5
6
7
8
9
# .wundergraph/operations/CreateUser.graphql
mutation ($input: CreateUserInput!) {
createUser: user_createUser(input: $input) {
id
name
bio
email
}
}

WunderGraph will automatically "compile" this Operation into a JSON-RPC API, and generate a TypeScript client for you, which we can call from our Node.js application.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { createClient } from '../components/generated/client';
const createUser = async () => {
const client = createClient();
const out = await client.mutate({
operationName: 'CreateUser',
input: {
name: 'Jens',
bio: 'Founder@WunderGraph',
},
});
console.dir(out);
};
createUser();
Previous
SolidJS

Was this article helpful to you?
Provide feedback

Edit this page