core icon indicating copy to clipboard operation
core copied to clipboard

Add support for graphql

Open kaushik94 opened this issue 7 years ago • 10 comments

Currently open data provides only a REST api and an optional SQL query endpoint. It would be nice to also have a graphql endpoint to execute more complex queries

kaushik94 avatar Jul 12 '17 02:07 kaushik94

On /matches? I could see that potentially being useful for reducing the amount of data transferred with each match request.

Not sure if graphQL provides the full range of querying that SQL does (for explorer data) though.

howardchung avatar Jul 12 '17 02:07 howardchung

No the /explorer endpoint. We can have another endpoint like say, /graphql-explorer and then access our data layer there. I am starting out on graphql recently, do you want me to give it a try?

kaushik94 avatar Jul 12 '17 02:07 kaushik94

sure, feel free to prototype something and set up a demo.

You can probably just implement it in routes/spec.js as a new endpoint

howardchung avatar Jul 12 '17 02:07 howardchung

For now even though we might not be able to support native graphql queries out of the box we can have a graphql wrapper or something on top of our rest endpoints. So that even though we don't graphically represent our data, we can still serve requests that assume we do.

kaushik94 avatar Jul 12 '17 02:07 kaushik94

maybe something like this library: https://github.com/postgraphql/postgraphql

howardchung avatar Jul 12 '17 03:07 howardchung

If anyone needs help with GraphQL, don't hesitate to ping me on Discord.

dartharaknus avatar Jul 12 '17 16:07 dartharaknus

I think @farmasek is working on this

howardchung avatar Oct 26 '17 08:10 howardchung

Correct, I am working on it, didn't have a lot time recently but it's WIP

farmasek avatar Oct 26 '17 10:10 farmasek

What's the status on this? GraphQL brings a lot of useful features in for developers like GraphQL schema types, fragments, the option to query what you need and much more (it's also easier to implement from my point of view since you have an explorer at your hand).

bdbch avatar Apr 25 '21 01:04 bdbch

I think it's better for writing web apps that consume the API, but more complicated for scripts and other automatic processes to consume GraphQL. I'm open to PRs adding the functionality, but probably won't have the bandwidth to work on GraphQL features myself.

howardchung avatar Apr 25 '21 05:04 howardchung