0.0.2 • Published 1 year ago

gql-typed-query-builder v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

GraphQL Query Builder

A simple helper function to generate GraphQL queries using plain JavaScript Objects.

But the cool part is it's have types :tada:

How to use

const query = graphql<Todo>({
  name: 'todos',
  fields: [
    'id',
    'name',
    'complete'
  ]
})

console.log(query)
"query { todos { id name complete } }"

More examples: Tests

Ohh it's based on https://github.com/atulmy/gql-query-builder