e-graphql-client

1.0.12 • Public • Published

EGQL

E-GraphQL Client library is the best library to fetch data from backend that run on E-GraphQL Servers. It allows you to easily handle data fetching.

Maintainers


Fetch form the server

import { gql } from 'graphql-request';
import { get } from 'e-graphql-client';

const COUNTRIES_QUERY = gql`
  query {
    country(code: "IN") {
      code
      name
      continent {
        name
      }
    }
  }
`;

const data = await get<{ country: { name: string; code: string } }>(
  'https://countries.trevorblades.com/',
  COUNTRIES_QUERY,
);

API Reference

get url - The Base URL for the E-GraphQL Server.
document - The GraphQL query.
variables - Variables used in query (optional).
requestHeaders - Headers to be sent to the server (optional).

This documentation is a work in progress.

Package Sidebar

Install

npm i e-graphql-client

Weekly Downloads

0

Version

1.0.12

License

MIT

Unpacked Size

8.97 kB

Total Files

17

Last publish

Collaborators

  • chaithumohan