xenk
v0.2.1
Published
Xenk - a query builder for GraphQL
Downloads
3
Readme
xenk
GraphQL query builder.
examples
import {createQuery, field, types} from 'xenk'
const queryField = field(
'post',
[
'id',
'title',
'text',
field('author', ['name', 'email'])
],
{id: 'postid'}
);
const query = createQuery(queryField, {
postid: types.id.notNull
});
console.log(query)
/*
query ($postid: ID!) {
post (id: $postid) {
id
title
text
author {
name
email
}
}
}
*/