Genql
Converter
Introducing Genql 1.0
Type safe Graphql
query builder
Genql generates a typed graphql client
for your graphql api to use in browser or node.
import { createClient, everything } from '@genql/my-lib'
await createClient().query({
User: {
name: true,
surname: true,
address: {
...everything,
}
}
})
works in browser and node

Graphql queries written in code

Genql generates a graphql client with typescript types, giving you type safety and auto completion

1
2import { createClient, everything } from '@genql/my-lib'
3
4await createClient().query({
5 User: {
6 name: true,
7 surname: true,
8 address: {
9 ...everything,
10 }
11 }
12})
1
2query {
3 User {
4 name
5 surname
6 address {
7 city
8 state
9 }
10 }
11}

Auto completion

Queries written with a genql client support auto completion thanks to typescript typings

Type Validation

Every query written with genql is validated against its schema, you can't write invalid queries anymore

@genql/cli

Generate your own graphql SDK in seconds

You can generate the client locally based on an endpoint or a local graphql schema.

Resources
Who made this?
Proudly sponsored by Vercel
Copyright © 2021 Genql