gql-query-ninja
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

gql-query-ninja

Query builder for GraphQL

npm i gql-query-ninja

Features

  • Query, Mutation, Subscription
  • Nested fields
  • Merging different queries into one
  • Auto vars generating when using args
  • Composable API

Get Started

import { Query } from 'gql-query-ninja'
 
new Query('tasks')
  .args({
    taskId: {
      type: 'String',
    },
  })
  .fields({
    id: true,
    name: true,
    desc: true,
  })
  .build()

and as a result you will get:

query (
  $taskId: String!
) {
  tasks (
    taskId: $taskId
  ) {
    id
    name
    desc
  }
}

Examples

For more examples check out tests

Readme

Keywords

none

Package Sidebar

Install

npm i gql-query-ninja

Weekly Downloads

0

Version

1.0.3

License

none

Unpacked Size

12.3 kB

Total Files

16

Last publish

Collaborators

  • viktor.konsta