Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 860 Bytes

README.md

File metadata and controls

38 lines (25 loc) · 860 Bytes

GraphQL Query Builder

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

But the cool part is it's have types 🎉

downloads

Install

npm install gql-typed-query-builder --save or yarn add gql-typed-query-builder

How to use

import graphql from 'gql-typed-query-builder'

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