Skip to content

claudioluciano/gql-typed-query-builder

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published