API HTTP Handlers

According to the documentation it seems like Functions is another name for an HTTP request handler? I’m curious why the documentation doesn’t outright say that you can generate or that rwjs supports custom HTTP endpoints?

Our product developers have started to leverage graphql in ways that seem unsupported or boundary use cases to support our needs. I think the lack of mentioning HTTP endpoint handlers in the docs contributes towards this pattern of using graphql for everything in redwoodjs.

Hi @aubs Thanks for asking!

I’m going to use this doc as a reference point for discussion:

You’re correct in that the architecture of Redwood’s functions was due to “serverless-first”. But by no means was that meant to limit use case — it’s just a convention. As of now, we’re definitely moving to “fastify-first” roadmap and seeing most startups move production apps to traditional, “serverful” architecture. (Note: we’ll always support serverless and Jamstack deployments, to be clear.)

Functions are != HTTP request handler (e.g. it’s not a 1-1). But, yes indeed, you can use them for that.

I’m curious why the documentation doesn’t outright say that you can generate or that rwjs supports custom HTTP endpoints?

^^ To be clear, this is not because it’s not a good idea, e.g. some pattern mean to be avoided. It’s probably just because the docs need to be better. (Maybe we unintentionally assumed it was obvious.) I.e. if it wasn’t clear to you, can you help us make it more clear?

Our product developers have started to leverage graphql in ways that seem unsupported or boundary use cases to support our needs.

If you haven’t already, I’d encourage you to discuss these types of use cases here in the Forums. There are some very knowledgable devs that are very far along with production applications. More importantly, sharing more use cases helps us (Core Team) better understand what needs to be improved, added, standardized, etc.

I think the lack of mentioning HTTP endpoint handlers in the docs contributes towards this pattern of using graphql for everything in redwoodjs.

Redwood is intended to be highly extensible — not a “lock in” to any specific tech.

Again, I don’t know your use case and can’t weigh in on pros/cons to you devs “using graphql for everything in redwoodjs”. But we’d welcome you and your team’s help to improve the reality of our vision to make Redwood the kind of framework where you can build custom implementations of X as required.