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

port to graphql!?! #139

Open
hannesm opened this issue Sep 15, 2016 · 13 comments
Open

port to graphql!?! #139

hannesm opened this issue Sep 15, 2016 · 13 comments

Comments

@hannesm
Copy link
Member

hannesm commented Sep 15, 2016

http://githubengineering.com/the-github-graphql-api/ -- fewer data transferred than using the REST API

@dsheets
Copy link
Member

dsheets commented Sep 15, 2016

And finally real, GitHub-provided types! I'm investigating this now (but it will likely be some time before it leaves Early Access). In the mean time, we'll have 1.2 and maybe 1.3 but we should start building the infrastructure for 2.0.

@avsm
Copy link
Member

avsm commented Sep 15, 2016

GraphQL has a type system that forces the server to be unambiguous about requests it receives and responses it produces.

I'm crying tears of typing joy

@yallop
Copy link
Member

yallop commented May 22, 2017

@avsm
Copy link
Member

avsm commented May 26, 2017

GraphQL server in OCaml: https://discuss.ocaml.org/t/ann-graphql-0-1-0/282

@andreas
Copy link

andreas commented Jul 12, 2017

I have something working now, which may be of interest: andreas/ocaml-graphql-server#56

I would be happy to hear if you have any thoughts on how graphql-ppx could work with ocaml-github, or if you have any particular requirements.

@andreas
Copy link

andreas commented Jul 13, 2017

Here's a simple example of how it could work with Lwt, Cohttp and Github GraphQL API: github.ml.

If you check out the branch locally, you can build with jbuilder build graphql-ppx/examples/github.exe and run with GITHUB_TOKEN=xyz ./_build/default/graphql-ppx/examples/github.exe.

@shinzui
Copy link

shinzui commented Feb 1, 2018

@andreas did you delete the github example?

@andreas
Copy link

andreas commented Feb 1, 2018

It's available here: https://github.com/andreas/ppx_graphql/blob/master/examples/github.ml

@XVilka
Copy link

XVilka commented Apr 23, 2020

A lot has changed since and the v3 API is getting slowly deprecated, the transition is imminent, see more at:

It will require GraphQL library by @andreas. See its repository at andreas/ocaml-graphql-server.

@andreas
Copy link

andreas commented Apr 23, 2020

It will require GraphQL library by @andreas. See its repository at andreas/ocaml-graphql-server.

Actually the GraphQL PPX I mentioned above is no longer available in ocaml-graphql-server -- the library is now solely for writing GraphQL servers, not clients 🙂

The most mature GraphQL PPX library is currently reasonml-community/graphql_ppx, though it's not getting a lot of love in terms of OCaml/OPAM.

@Zimmi48
Copy link

Zimmi48 commented Aug 3, 2020

@XVilka Contrary to what you are claiming the GitHub REST API (v3) is not at all getting deprecated. In issue ocaml-opam/opam-publish#97, the title is misleading, it's just the authentication method that is getting deprecated.

There isn't much point in porting the ocaml-github library to GraphQL IMHO because this library provides OCaml bindings to the REST API resources but, when you use GraphQL, the needs of each user are quite different and therefore, they directly need to write their GraphQL queries (no point in providing bindings).

The graphql_ppx library mentioned by @andreas above is indeed awesome (since it types your requests) and it is the only thing you need if you want to build an OCaml project depending on GraphQL. Its latest version is available in opam now (thanks to my intern who opened ocaml/opam-repository#16540) and it's actively used in the coqbot project (https://github.com/coq/bot/, cf. the bot-components folder).

@roddyyaga
Copy link

The fix for that opam-publish issue was made in this PR, available in 4.3.0.

@XVilka
Copy link

XVilka commented Aug 3, 2020

@roddyyaga it broke the authorization though, see:

Thus, current recommendation is to use 4.2.0 instead.

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

9 participants