tql
tql copied to clipboard
Support 0-codegen w/TypeScript-defined GraphQLSchemas
See if we can do some integration with graphql-nexus and typegraphql.
A newer code-first schema builder: https://github.com/hayes/giraphql
An even newer and better one https://github.com/whats-good/uniform-graphql
We could define various utility type adapters that make use of our dynamic buildSelector
runtime facility.
Examples:
import { t } from '@whatsgood/uniform-graphql'
import type { T } from '@timkendall/tql/adapters/uniform-graphql'
import { buildSelector } from '@timkendall/tql'
const Membership = t.enum({
name: 'Membership',
values: {
free: null,
paid: null,
enterprise: null,
},
});
const User = t.object({
name: 'User',
fields: {
id: t.id,
email: t.string.nullable,
membership: Membership,
},
});
const user = buildSelector<T<typeof User>>('User')
const selection = user(t => [
t.id(),
t.email(),
t.membership(),
])
// .toFragment
// .toInlineFragment
// .toSelectionSet
// .toString
https://github.com/sikanhe/gqtx