@shitty-scope-name/hasura-testing-client-example

Graphql client

Usage no npm install needed!

<script type="module">
  import shittyScopeNameHasuraTestingClientExample from 'https://cdn.skypack.dev/@shitty-scope-name/hasura-testing-client-example';
</script>

README

@shitty-scope-name/hasura-testing-client-example

Your awesome graphql client ❤️

Example usage

import { createClient } from '@shitty-scope-name/hasura-testing-client-example'
const client = createClient()



// variables
var query_root__user_by_pk__id

client
  .query({
    user_by_pk: [
      {
        id: query_root__user_by_pk__id,
      },
      {
        id: true,
        name: true,
      },
    ],
    user_aggregate: {
      aggregate: {
        count: 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,
        name: true,
      },
    ],
  })
  .then(x => console.log(JSON.stringify(x, null, 4)))




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




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