tql icon indicating copy to clipboard operation
tql copied to clipboard

Support 0-codegen w/TypeScript-defined GraphQLSchemas

Open timkendall opened this issue 4 years ago • 4 comments

See if we can do some integration with graphql-nexus and typegraphql.

timkendall avatar Feb 14 '21 03:02 timkendall

A newer code-first schema builder: https://github.com/hayes/giraphql

timkendall avatar Feb 15 '21 21:02 timkendall

An even newer and better one https://github.com/whats-good/uniform-graphql

timkendall avatar Oct 25 '21 02:10 timkendall

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

timkendall avatar Oct 25 '21 02:10 timkendall

https://github.com/sikanhe/gqtx

timkendall avatar Jan 17 '22 02:01 timkendall