Skip to content

Latest commit

 

History

History
67 lines (52 loc) · 1.33 KB

README.md

File metadata and controls

67 lines (52 loc) · 1.33 KB




Type safe Graphql query builder

Write Graphql queries with type validation and auto completion



Generate your client package at genql.now.sh or read the quick start guide to generate a client locally instead

🔥 Features

  • Type completion
  • Type validation
  • Easily fetch all fields in a type
  • Support subscription
  • Graphql Client built in
  • Works with any client
  • Works in node and the browser

Example

First generate your client filling the form at genql.now.sh

Then you can use your client as follow

import { createClient, everything } from '@genql/my-package'
const client = createClient()

client
    .query({
        countries: {
            name: true,
            code: true,
            nestedField: {
                ...everything,
            },
        },
    })
    .then(console.log)

The code above wil fetch the graphql query below

query {
    countries {
        name
        code
    }
}

Sponsors

Vercel


Licensed under MIT.