@cjenaro/fetchql
v1.0.0
Published
A GraphQL wrapper for browser's fetch
Downloads
2
Readme
fetchql
A GraphQL wrapper for the browsers native fetch.
Example:
fetchql(
"https://rickandmortyapi.com/graphql/",
gql`
query CHARACTERS($name: String!) {
characters(filter: { name: $name }) {
results {
id
name
status
species
type
origin {
name
}
image
}
}
}
`,
{
name,
}
).then(
(data) => {
console.log(data);
},
(error) => {
console.log(error);
}
);