ethereum / go-ethereum

Go implementation of the Ethereum protocol
https://geth.ethereum.org
GNU Lesser General Public License v3.0
47.13k stars 19.95k forks source link

Implement filter functionality using subscriptions in Graphql #24518

Open srghma opened 2 years ago

srghma commented 2 years ago

Rationale

Why should this feature exist?

grapqh is easier to debug and try-out than rpc

What are the use-cases?

  1. Subscribe to log changes in /graphql/ui (probably arguments should contain fields for eth_newFilter)
  2. ... what else can be implemented using graphql subscriptions?

Implementation

Do you have ideas regarding the implementation of this feature?

this is how postgraphile adds subscriptions

https://github.com/graphile/postgraphile/blob/7c15ce5b275ff41969c631c1d6d1d46c0bcdb6dc/postgraphiql/src/components/PostGraphiQL.js#L168

https://www.graphile.org/postgraphile/subscriptions/

Are you willing to implement this feature?

not sure

s1na commented 2 years ago

I agree this is a useful feature and would also make the graphql endpoint more self-contained. Though it is a bigger feature and it'd be nice to have cross-client coordination on its design, which will be easier after the schema becomes a living document as per https://github.com/ethereum/execution-apis/issues/163.

srghma commented 2 years ago

will rename since it seems like the filter functionality is the only one that is left to implement

https://eips.ethereum.org/EIPS/eip-1767

2022-03-09-04pm-38-49-screenshot