Optional GraphQL interface #58
Replies: 9 comments 7 replies
-
A GraphQL API solution would be redundant with a REST API. The contenders:
Seaography
Juniper
async-graphql
From above, async-graphql seems to be the better candidate for us. |
Beta Was this translation helpful? Give feedback.
-
Well I'm worried about having GraphQL and not using it for serving API endpoints where it helps. I believe this is a strategic decision to be taken because REST and GraphQL features overlap each others to serve an API. Depending on the type of a project, one or the other could be used. Of course since the Trustify project is micro services then we could use REST for some services and GraphQL for other services. The feedback from some devs on the trustification expressed a bad experience with GraphQL from GUAC. Of course with a new/recent tech we have to draw the line between stability, community support against technology jump that a new paradigm can bring. This is not the case here, GraphQL has been out long enough Therefore to decide which tech to use for a project or its micro services parts boils down to evaluate the API needs and match its complexity against the more adapted tool. Then if Seaography doesn't support mutations then it cannot be used to fulfill a proper API service. |
Beta Was this translation helpful? Give feedback.
-
@gildub if you find success before next week's meeting, I'd vote for plonking a link to a video or whatever write-up/example/demo you have here. Relentless forward progress! |
Beta Was this translation helpful? Give feedback.
-
Juniper ended up to be the most straightforward to implement and is pretty aligned with GraphQL standard. The following branch contains a basic GraphQL API using Juniper with requests for SBOMs (get all sboms, get one sbom and create a sbom). https://github.com/gildub/trustify/tree/graphql-poc GraphQL API examplesUsing CURLRetrieving SBOMs
Create (Mutate) a SBOM
Using GraphiqlScreencast.from.2024-03-26.17-10-10.webm |
Beta Was this translation helpful? Give feedback.
-
The Juniper initial easiness was shadowed once we approached more advanced features such as exploiting one to many (1:m), or many to many (n:m) relationships. Juniper unfortunately requires to replicate the model's structure (because the object's structures must be in the same crate scope which doesn't work for us because the model is in another crate). The next step is to investigate Async-graphql which I initially put aside because mutation are not available yet. And also because in practice Juniper was really easy to get started with. |
Beta Was this translation helpful? Give feedback.
-
@bobmcwhirter, from what we've learned and my above comment I'm working on a graphql POC using async-graphql. |
Beta Was this translation helpful? Give feedback.
-
Random observation: graphql is fine for read ... though can often be challenging to support updates especially if there is no graph store backend. |
Beta Was this translation helpful? Give feedback.
-
Initial POC using async-graphql framework : https://github.com/gildub/trustify/tree/async-graphql-poc |
Beta Was this translation helpful? Give feedback.
-
The following PR is adding an https://github.com/gildub/trustify/tree/server-grapqhl This is replacing the former async-graphql-poc branch mentioned above. |
Beta Was this translation helpful? Give feedback.
-
Some parties will enjoy/prefer a GraphQL-oriented API for accessing information within Trustify.
Not as our own primarily internally-consumed API, but for unknown integrations external to us.
Seaography? Postgres GraphQL extension? Dunno!
Beta Was this translation helpful? Give feedback.
All reactions