core
core copied to clipboard
Add support for graphql
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
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.
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?
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
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.
maybe something like this library: https://github.com/postgraphql/postgraphql
If anyone needs help with GraphQL, don't hesitate to ping me on Discord.
I think @farmasek is working on this
Correct, I am working on it, didn't have a lot time recently but it's WIP
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).
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.