does anyone know how to get prisma-bindings to aut...
# orm-help
c
does anyone know how to get prisma-bindings to autocomplete in vscode?
h
You can use typescript version of them that has autocompletion in vscode
c
can I use that if my code isn't typescript?
do I need to mess with my babel config to work with ts files?
and will it work on files which don't actually import the prisma object, because it usually comes in the resolver through
ctx.db
h
Yes TS will work if you type your context
I guess if you are using javascript right now, you should not migrate immediately. Consider TS for next project
c
so I can only get the autocomplete with ts 😕
might look at converting for my serverside
I don't have a whole lot right now
thx
h
Yes, cause the typescript client generates the types and those are then consumed by vscode for autocompletion
c
ok
ill take a look at converting
never had a good reason to convert till now since I have been using ES7 syntax
h
Tip: you can gradually convert as js is valid typescript
c
so if I start by just renaming my files to ts
and switch my babel config
h
you will need a tsconfig now
c
it should be enough to get the binding complete?
h
you will need to remove babel
c
oh it has its own compiler right
h
or you can use babel typescript plugin if you really want to use babel
c
does ts have the latest es7 syntax stuff
like class props
h
yes it has it all 🙂
c
ok cool
thx
h
it even has decorators
I guess I can give you an example repo
c
I can figure it out
thx though
h
which server are you using, graphql-yoga?
c
no I switched
to apolloserver
well apollo-server-express
forgetting now what finally made me switch, I know one reason was ApolloServerErrors weren't working
h
ok, the resolvers have same pattern so have a look here https://github.com/prisma/graphql-yoga/tree/master/examples/prisma-ts
Well all the best for your conversion 🙂
c
yea I barely changed any of my code when I switched
are you on the prisma team?
h
Ya, I have just started my work yesterday 🙂
c
cool, I like it so far
thx have a good night
🙌 1