1.0.4 • Published 3 years ago

@banez/graphql-client v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

GraphQL Client

NPM Version

This project is a simple and easy GraphQL client based on project created by nordsimon. Is far as I was able to see this package is not maintained any more and it does not provide types. Since I personally liked it for its simplicity, small footprint and ease of use, I decided to refactor it and move it to typescript. I hope that you will find it useful.

Usage

const graphql = createGraphQLClient({
  url: 'https://api.spacex.land/graphql/',
});

const result = await graphql<{
  ships: Array<{
    name: string;
    image: string;
  }>;
}>(
  `
    query ($limit: Int!) {
      ships(limit: $limit) {
        name
        image
      }
    }
  `,
  {
    limit: 10,
  },
);

console.log(result);
1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago