ohler55 / agoo

A High Performance HTTP Server for Ruby
MIT License
912 stars 39 forks source link

How to create a dynamic GraphQL schema #95

Closed JosimarCamargo closed 4 years ago

JosimarCamargo commented 4 years ago

Hello, I'm creating a GraphQL API with Agoo(with has been really awesome), within a scenario where each user can have his own types, I was wondering if there is some way to create and load those types, based on the request headers?

ohler55 commented 4 years ago

There is not currently a way to do what you describe directly. The GraphQL engine is current linked to a server so it is no possible to have multiple engines for a single server. The only way I can think of to do that right now would be to spin up a different server for a user when they log in. If you have a small number of users that might not be an issue. If you have hundreds all accessing at the same time it might be too much.

JosimarCamargo commented 4 years ago

That is sad news, my company was rewriting our GraphQl API with Agoo, due to high performance, and how we have several clients and they can create their own types, a GraphQL API that allow to us create types on the flight is a must have to us. Please don't take this bad, you are doing a really awesome work here, thanks for all support.

ohler55 commented 4 years ago

There are some possibilities to create types on the fly we could discuss. Keeping them separate is not currently supported though.

JosimarCamargo commented 4 years ago

I'll talk with my teammates about it, thanks again

VojislavVlasic commented 2 years ago

Hello @ohler55, hope you're doing well. Just to check in with you, does agoo support dynamic GraphQL schema creation now by any chance?

ohler55 commented 2 years ago

I have not added that. I'm a bit unclear as to how that would be implemented. I can see adding types but what would they be backed by?