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

GraphQL API #882

Closed
lastmjs opened this issue May 6, 2020 · 8 comments
Closed

GraphQL API #882

lastmjs opened this issue May 6, 2020 · 8 comments

Comments

@lastmjs
Copy link
Contributor

lastmjs commented May 6, 2020

Is your feature request related to a problem? Please describe.

Traditionally Ethereum clients have exposed their APIs through JSON RPC, or perhaps REST. Though functional, there are some drawbacks to this approach. One of the main drawbacks IMO is requiring developers to learn yet another protocol for requests. Each application that exposes an API over http has different rules and syntax. GraphQL provides a solution to some of these drawbacks, mostly through its standard and flexible query language.

Describe the solution you'd like

Like Geth has done with their Ethereum client, I would love to see a GraphQL API exposed, along with the current REST API. I would be happy to consider doing this work myself.

@wemeetagain
Copy link
Member

Hi @lastmjs , love the idea.
Eth2 as a whole is trying to standardize the APIs across clients here: https://github.com/ethereum/eth2.0-APIs/
I believe what we have so far matches that spec.
It's still a work in progress, here's the agenda from the last API call: ethereum/eth2.0-pm#143
here's our API related code: https://github.com/ChainSafe/lodestar/tree/master/packages/lodestar/src/api

@lastmjs
Copy link
Contributor Author

lastmjs commented May 6, 2020

Awesome, so is it best to try to get a GraphQL API standardized through that channel then before any implementation here? Should this issue remain open?

@mpetrunic
Copy link
Member

GraphQL won't be standardized across clients, you can read about reasoning here: ethereum/consensus-specs#1012

It will be additional feature that some clients expose.

@mpetrunic
Copy link
Member

mpetrunic commented May 6, 2020

Oh, I think arguments against GraphQL wasn't int that issue(there is only why REST api was decided), I think arguments against starting with standardized graphql was in api call somewhere

@wemeetagain
Copy link
Member

Yeah, I think we can implement this in parallel to standardization. It seems from the call notes that there was some interest in GraphQL, but maybe not as an officially standardized API. (You might ask about interest in the eth2 discord)
In any case, I'm sure working through what the schema should be would be a helpful exercise for everyone.

@mpetrunic
Copy link
Member

It would be cool to use https://github.com/IBM/openapi-to-graphql to generate graphql schema from rest openapi definition in api spec repo

@stale
Copy link

stale bot commented Jul 5, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the bot:stale label Jul 5, 2020
@stale
Copy link

stale bot commented Jul 12, 2020

This issue or pull request has been automatically been closed due to inactivity.

@stale stale bot closed this as completed Jul 12, 2020
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

3 participants