@banez/graphql-client
v1.0.4
Published
Simple and easy GraphQL client.
Downloads
65
Readme
GraphQL Client
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);