1.0.0 • Published 5 years ago

@genql/hasura-example-client-1 v1.0.0

Weekly downloads
1
License
-
Repository
-
Last release
5 years ago

@genql/hasura-example-client-1

Your awesome graphql client ❤️

Example usage

import { createClient } from '@genql/hasura-example-client-1'
const client = createClient()



client
  .query({
    user: {
      age: true,
    },
  })
  .then(x => console.log(JSON.stringify(x, null, 4)))




client
  .query({
    user_aggregate: {
      nodes: {
        name: true,
      },
    },
    user: {
      id: true,
      name: true,
    },
  })
  .then(x => console.log(JSON.stringify(x, null, 4)))




// variables
var query_root__user_by_pk__id

client
  .query({
    user_aggregate: {
      aggregate: {
        var_samp: {
          age: true,
        },
        avg: {
          age: true,
        },
        max: {
          name: true,
        },
        min: {
          age: true,
        },
        stddev_pop: {
          age: true,
        },
        sum: {
          age: true,
        },
        variance: {
          age: true,
        },
      },
    },
    user: {
      age: true,
      name: true,
    },
    user_by_pk: [
      {
        id: query_root__user_by_pk__id,
      },
      {
        id: true,
        name: true,
      },
    ],
  })
  .then(x => console.log(JSON.stringify(x, null, 4)))




// variables
var query_root__user_by_pk__id

client
  .query({
    user_by_pk: [
      {
        id: query_root__user_by_pk__id,
      },
      {
        age: true,
        id: true,
      },
    ],
  })
  .then(x => console.log(JSON.stringify(x, null, 4)))