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

Graphql client

Usage no npm install needed!

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

README

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

Your awesome graphql client ❤️

Example usage

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



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




client
  .query({
    user_aggregate: {
      aggregate: {
        var_pop: {
          age: true,
        },
      },
    },
    user: {
      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,
      },
      {
        name: true,
      },
    ],
  })
  .then(x => console.log(JSON.stringify(x, null, 4)))




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