Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why GraphQL was replaced with Swagger UI? #19

Open
akondas opened this issue Nov 18, 2018 · 3 comments
Open

Why GraphQL was replaced with Swagger UI? #19

akondas opened this issue Nov 18, 2018 · 3 comments

Comments

@akondas
Copy link

akondas commented Nov 18, 2018

(from pure curiosity)

@codeliner
Copy link
Member

Here is the corresponding release with information in linked PRs: https://github.com/proophsoftware/event-machine/releases/tag/v0.14.0

in short: GraphQL does not include format validation, so JSON Schema was always main target.
GraphQL has a nice Dev UI and I was curious if GraphQL and JSON Schema can be combined. It worked somehow, but always felt wrong. It wasn't possible to use all available JSON Schema features nor all GraphQL features due to mapping limitations.

@camuthig Started to experiment with Swagger UI integration so we were able to remove GraphQL but still have a tool to interact with the backend without much effort.

Message and type schema definition is much simpler now. We don't need to differentiate between Input types and response types (like required by GraphQL). Nested objects can be defined without explicit types. AnyOf, OneOf definitions can be used and so on.

That said, if one wants to use GraphQL, recommendation is to put a GraphQL layer in front of Event Machine (same for REST API). Another option is to use GraphQL for read access and don't implement Queries + Finders/Resolvers in Event Machine.
Read and Write can be separated thanks to CQRS.

@akondas
Copy link
Author

akondas commented Nov 20, 2018

Thanks for your comprehensive answer. I wonder if it is not worth keeping a kind of decision log (similar to changelog) for such decisions ... 🤔

@codeliner
Copy link
Member

That's basically a good idea. I always try to link related issues in releases. GraphQL was dropped in the experimentation phase. I thought we had a discussion somewhere in an issue but seems to be that it was discussed in the prooph chat.

We're still experimenting but get closer to a stable feature set and have some important news waiting to be published ;)

Event Machine v1.0 is only a milestone to give existing projects a stable base, but we're heading towards v2.0 with an optimized Event Machine core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants