Hi there, Does anyone have experiences in using <h...
# general
j
Hi there, Does anyone have experiences in using https://typegraphql.com/ with the https://docs.serverless-stack.com/api#graphql-api?
t
we're currently working on a first class Pothos setup which is similar to typegraphql
t
I've used type-graphql with the
GraphQLApi
at least for me, I didn't run into any major issues
other than type-graphql still expecting graphql v15, but they have a branch where they seem to be updating to v16
d
There are some issues around ESBuild, TS, and decorators (not insurmountable, but you would need a couple settings in place)
We tried out type-graphql, and ended up using
graphql-compose
instead. Not really a solid reason other than it’s a little simpler and has no build issues whatsoever since it is standard code.
FWIW, I asked this same question a few months ago and no one responded at that time.
t
graphql-compose is nice
d
much better way to cut duplication than fragments, (in our humble opinion)
syntax takes a few groks though, lol
t
If you do want to use typegraphql, here's a simple example: https://github.com/tysoncadenhead/sst-type-graphql-example
j
@Tyson Cadenhead looks nice 🤩 I followed the documentation from typegraphql and failed at the server because of top-level-await. Furthermore, I find the typegraphql pretty complicated..
t
What was wrong with top level await?
FYI we support that in SST just set your bundle.format to esm
j
graphql-compose
looks really nice
t
yeah, there's definitely a learning curve to typegraphql. It does have a nice developer experience once you get it going, especially if you're using a type-safe database provider like Prisma, but it can be a pain to setup and read through the docs initially
j
@thdxr Ah that might be the reason. I was doing something like
Copy code
const schema = await buildschema();
const server = new ApolloServer({
  schema
  introspection: !!process.env.IS_LOCAL,
});