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
}
}
}
*/
-
Notifications
You must be signed in to change notification settings - Fork 0
Xenk - a query builder for GraphQL
License
karudo/xenk
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Xenk - a query builder for GraphQL
Topics
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published