PoC wrap GraphQL with restful endpoints
Problem
Sharing implementations between GraphQL and REST is currently challenging.
Can we define RESTful endpoints that in turn uses persisted GraphQL queries?
Proposal
This proposal defines REST endpoints in terms of GraphQL queries, with attached metadata to determine mount points and HTTP verbs.
Currently it is fairly basic, but things to support would be:
- An intelligent caching mechanism that avoids doing unnecessary work (similar to
present_cached
) - OpenAPI schema generation for each endpoint
- JSON API compatible output
Things we need to do before considering this for production:
- ways to handle array/object parameters
- memory/throughput profiling
Next Steps
-
Test performance and viability of using Raisin
as an alternative to an existing API. -
Test performance and viability of using Raisin
to add a REST endpoint where we have gaps. (Note: It appears our functional tests have passed save for the JH jobs you mentioned, but the question is if we've validated theRaisin
endpoints will be viable alternatives to our current approach) -
Document and share this to other teams as a PoC. -
Have 3-5 teams validate this will work for them to build new APIs, update existing APIs, and address REST gaps. -
Iterate based on feedback. -
Once validated, work to implement automated docs and any other process improvements to automate the process of building GQL APIs with a REST wrapper.
Edited by Grant Hickman