libplanet icon indicating copy to clipboard operation
libplanet copied to clipboard

Seperating APIs for node ops from `Libplanet.Explorer`

Open longfin opened this issue 3 years ago • 0 comments

When posting #2130, I've wanted to move GraphQL mutations from NineChronicles.Headless to Libplanet.Explorer. but then I felt awkwardness...

  • Libplanet.Explorer had been intended as a set of query, not mutation.
  • GraphQL is commonly used to describe APIs for data platforms. I don't think it's suitable for adding tx to the stage, or for signing unsigned transactions.

Therefore, I suggest as like below

  • Separting (or duplicating) some node-related APIs from Libplanet.Explorer and NineChronicles.Headless to new project. (call it Libplnet.NodeAPI)
  • Like as Libplanet.Explorer, Libplanet.NodeAPI is a library project and can be injected by .NET DI. (like MagicOnion)
  • Instead of GraphQL, Libplanet.NodeAPI relies OpenAPI[^1] to provide direct API instead of query.
    • GraphQL is still possible option for Libplanet.NodeAPI considering environment like graphql-playground, but Swagger seems comparable.

Maybe there are some misunderstandings because I'm still not familiar with GraphQL. Feel free to leave a comment. 🙏

[^1]: Or, any other spec is welcome.

longfin avatar Jul 01 '22 15:07 longfin