Middleware Pattern w/ Actions (Re-Use Types, Less Boilerplate) #7824
Labels
c/actions
Related to actions
k/enhancement
New feature or improve an existing feature
k/v3-beta
t/gql-services
Is your proposal related to a problem?
Preface: I'm aware of ALL of documented Hasura features as of time of writing.
One of the main concerns I hear about with Hasura is how unwieldy the Actions/Types, etc will get once the API matures and there has to be TONS of exceptions for intermediary logic between the initial GraphQL request & the response. Obvious examples are:
Currently, every exception requires an Action w/ Derived types that needs to be maintained from there on, etc, and this is going to be rough once the API matures. If the boilerplate was simpler, and the types for these actions could be automatically derived from the original request, this would make maintenance simpler by using introspection & codegen for TS types in code, etc.
Describe the solution you'd like
I quite honestly don't know what this solution looks like yet, consider Hasura is written in Haskell. I would like to start a conversation about how this could improve.
Describe alternatives you've considered
Simple examples of other setups being more usable would be Node Express + custom resolvers, Prisma, etc, though I realize that Hausra has serious performance and initial time-to-launch advantages over these. Every middleware option in Node JS could be considered if you were using these other options.
If the feature is approved, would you be willing to submit a PR?
I have no idea how to write in Haskell, but I would be willing to contribute in JS/Node/TS environments and in any specification/planning manner.
Other Notes
Similar issues have been mentioned in the past, namely: #5001
If anyone has any questions, please let me know! I'm almost 100% dead set on using Hasura for my company's go-to web/app API stack in the near future, and I want to iron out all possible foreseen issues in near/mid-term scale before I commit. Thank you!
The text was updated successfully, but these errors were encountered: