News for hackers. Stuff that matters.

Front end API generation from GraphQL schema

Hi I just want to let you know we added frontend( TypeScript ) to our graphqleditor.com service - it is available right now on demo.graphqleditor.com so you can:

1. import your own schema

2. click typescript

3. click copy and copy it to your ts project

This way you have full intellisense on frontend tou your graphql queries. and you can construct them type safe. You need at least typescript 3.1 to make this work in your project.

Functions are defined as array of props and returners

This is complicated but you have 100% type safe query, return and response API.

This is much experimental but works for me! Feel free to ask questions report issues etc. I will post this on GrahphQL subreddit and Javascript subreddits to gather more lang experts

( 2 comments | 5 points | on HN )
Re:Front end API generation from GraphQL schema by tomekp on Thursday November 29, 2018 @07:32AM (#18559718)
Cool, but please make clickable links next time :) Will be a lot easier :)
Re:Front end API generation from GraphQL schema by aexol on Thursday November 29, 2018 @08:02AM (#18559849)
I dunno how to do it :|. Anybody?