ianfabs / jraph

A simple fetch-wrapper for making GraphQL API calls in a jiff!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jraph

A simple fetch-wrapper for making GraphQL API calls in a jiff!

Designed to feel similar to using apollo's graphql-tag function.

version bundlephobia total downloads

Build Status last commit license

graphql

NPM

Options

Jraph takes two parameters

  • URL

    • a URL string, this should be the URL to your graph-ql endpoint
  • Options

    • Basically just fetch params
    • Only works with post-requests right now please bear with me.

Basic Example

    import {jraph} from 'jraph';
    const gql = jraph("https://csb-xpwq1o2824-xravvsjkul.now.sh/");

    async function getItems(){
        return gql`{
           items{
              title
              info
           }
        }
        `
    }

About

A simple fetch-wrapper for making GraphQL API calls in a jiff!

License:MIT License


Languages

Language:JavaScript 48.6%Language:TypeScript 29.2%Language:HCL 22.1%