How to use the typed-graphqlify.types.number function in typed-graphqlify

To help you get started, we’ve selected a few typed-graphqlify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github acro5piano / typed-graphqlify / examples / index.ts View on Github external
/* tslint:disable */

import { params, query, types } from 'typed-graphqlify'

async function executeGraphql(gqlString: string): Promise {
  return 0
}

const getUserQuery = {
  getUser: {
    user: params(
      { id: 1 },
      {
        id: types.number,
        name: types.string,
        bankAccount: {
          id: types.number,
          branch: types.string,
        },
      },
    ),
  },
}

const gqlString = query(getUserQuery)

console.log(gqlString)
// =>
//   query getUser(id: 1) {
//     user {
github acro5piano / typed-graphqlify / examples / index.ts View on Github external
import { params, query, types } from 'typed-graphqlify'

async function executeGraphql(gqlString: string): Promise {
  return 0
}

const getUserQuery = {
  getUser: {
    user: params(
      { id: 1 },
      {
        id: types.number,
        name: types.string,
        bankAccount: {
          id: types.number,
          branch: types.string,
        },
      },
    ),
  },
}

const gqlString = query(getUserQuery)

console.log(gqlString)
// =>
//   query getUser(id: 1) {
//     user {
//       id
//       name
//       bankAccount {

typed-graphqlify

Build Typed GraphQL Queries in TypeScript. A better TypeScript + GraphQL experience.

MIT
Latest version published 2 years ago

Package Health Score

56 / 100
Full package analysis