Skip to content

Build a GraphQL Client #61

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

Closed
theduke opened this issue Jul 19, 2017 · 8 comments
Closed

Build a GraphQL Client #61

theduke opened this issue Jul 19, 2017 · 8 comments
Labels
enhancement Improvement of existing features or bugfix

Comments

@theduke
Copy link
Member

theduke commented Jul 19, 2017

All the pieces are there.

  • a parser
  • a type system
  • value types for representing graphql data

Building a client should be relatively straight forward.

I'll tackle this when I have some time.

@theduke theduke changed the title Client Build a GraphQL Client Jul 19, 2017
@theduke theduke added the enhancement Improvement of existing features or bugfix label Jul 23, 2017
@LegNeato
Copy link
Member

@theduke do you still intend to tackle this? I would love to help but feel my rust-fu isn't quite there yet.

@LegNeato
Copy link
Member

LegNeato commented Jan 25, 2018

@zsck mentioned in gitter that they might be interested in working on this and was looking for some pointers on how to get started.

@theduke
Copy link
Member Author

theduke commented Jan 25, 2018

Like we have documented, the first step would be to extract the parser and AST from the main crate to make it reusable.

This should also include making the AST easily shareable so it can be used with tokio.

I believe @mhallin already did some experiments on that in this branch: https://github.com/graphql-rust/juniper/tree/async-experiments

@tomhoule
Copy link
Member

As mentioned on the issue just above this comment, I released a graphql-client` crate and I plan to keep improving it. It's in a usable state now. Broader collaboration to make GraphQL in Rust a good experience is something I am interested in, so don't hesitate to leave your thoughts on issue 20 or other topics :)

@theduke
Copy link
Member Author

theduke commented Oct 10, 2018

Closing since we have the client in the org now.

We still need to figure out what code can be shared between the client and juniper, though.

@theduke theduke closed this as completed Oct 10, 2018
@tomhoule
Copy link
Member

There is another issue I opened about sharing query validation code (since it is in the spec and all that is needed is the query and the schema, as far as I know). Juniper has far better validation so the main beneficiary would be graphql-client. Other than that I don't have many ideas but it is of course interesting.

@theduke
Copy link
Member Author

theduke commented Oct 10, 2018

I guess in a perfect world we would share:

  • parser
  • AST
  • Value representation
  • Validation logic
  • testing utilities

It would also be awesome to instantiate a client from a server Schema definition,
without going through an introspection schema as a mediary.

I haven't looked at the client code yet so I don't know how feasible this is.

But that would be the ideal state for me.

@tomhoule
Copy link
Member

I have thought about using the juniper schema representation as an additional source (besides schema.json and .graphql schemas), but since graphql-client does code generation, we would need to instantiate the schema at compile time, which sounds challenging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of existing features or bugfix
Projects
None yet
Development

No branches or pull requests

3 participants