Can REST model be driven by GraphQL directives? #1093
Unanswered
asusnjar-nuvalence
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Just discovered Sofa. Made something similar before but, as all of us discovered, generic translation is unnatural. The way I understand Sofa, model customization is done by essentially configuring Sofa using JavaScript. This may work for me in the short term only - I might end up having many GraphQL microservices federated into one and that is where I'd like the REST wrapper to exist too and I don't want to have to keep updating those scripts to match the microservice evolution. I'd like to have them supply appropriate directives which then drive the model. Is this possible?
Thinking of, for example, a
@RESTmethods
directive on a type, explicitly stating the queries/mutations to be used for each of the CRUD operations mapped to HTTP methods + searches/collections and other operations - may as well be namedLIST
,GET
,POST
,PUT
,PATCH
,DELETE
, etc. or uselist
,get
,create
,update
,delete
. On fields the directives could indicate the kind of default inclusion - think hidden/never (never included in REST representation), optional (excluded by default but allows inclusion using OData $include), embedded, referenced (link/URL included), etc. Id/path map and mutations would require additional info.Beta Was this translation helpful? Give feedback.
All reactions