Skip to content

🦄 giin v0.1.1

Compare
Choose a tag to compare
@cuongndc9 cuongndc9 released this 30 Dec 17:54
5a61684

🦄 Have a Graphql client's feature: query and mutation

import { giin } from 'giin';
// const { giin } = require('giin');
giin({
  option: {
    url: 'https://example.com'
  },
  query: `
    query {
      user(id: $id) {
        id
        name
        age
      }
    }
  `,
  variables: {
    id: 1
  }
});

👻 Special 🚧: giin allows passing parameters as objects.

giin({
  option: {
    url: 'https://example.com'
  },
  query: `
    query {
      user(info: $info) {
        id
        name
        sex
        age
        address
        job
      }
    }
  `,
  variables: {
    info: {
      name: 'Cuong Duy Nguyen',
      address: 'Ho Chi Minh'
    }
  }
});