hasura / graphql-engine

Blazing fast, instant realtime GraphQL APIs on your DB with fine grained access control, also trigger webhooks on database events.
https://hasura.io
Apache License 2.0
31.07k stars 2.76k forks source link

Hasura should emit codegen files #6556

Open jgoux opened 3 years ago

jgoux commented 3 years ago

Hello all,

Today I find Hasura action's highly impratical in term of integration with TypeScript.

The codegen tab is a good idea, but why stop there and make people copy/paste code? It would be way better to emit at least the hasuraCustomTypes.ts file so we can directly import it and it becomes a reliable artefact. The console could just reflect changes to this file anytime we use the UI the modify the actions, and without touching anything else we would know that we broke our handler.

rossng commented 3 years ago

Better yet, integration with typescript-is to perform validation of JSON payloads against TypeScript types.

manasag commented 5 months ago

Hi, I want to update that we are launching Hasura V3 (DDN) this month. In V3, actions can directly be integrated using our new Typescript connector which introspects your functions and automatically expose the graphql types and schema to Hasura (you don't have to manage manually). Also with CLI tooling, the metadata is deterministically owned and managed by you, and not the state of the server. This paradigm may help you setup your CI/CD and assert the state of Hasura is a much better manner (and leveraging the typescript+express ecosystem to build your business logic).

I would highly suggest to join us to see the full power of Hasura DDN at the Hasura Dev Day on April 16 🎉. Sign up here: https://hasura.io/dev-day. Can't make it? Sign up anyway and we'll send you the recording.