graphql-rust / graphql-client

Typed, correct GraphQL requests and responses in Rust
Apache License 2.0
1.15k stars 158 forks source link

Discussion: implement the platform-specific clients as a wrapper around surf? #272

Open tomhoule opened 5 years ago

tomhoule commented 5 years ago

It would need to be a wrapper - request and response configuration do not vary, and we want to link variables, queries and response shapes.

We would get:

Cons:

h-michael commented 4 years ago

@tomhoule Is the platform-specific client you are referring to now referring to the graphql_client_web?

tomhoule commented 4 years ago

So I think we could replace the web client we have now with something more robust and maintained by other people, and at the same time this would give us a native HTTP client. That way we only need to interface with a single library (surf).

h-michael commented 4 years ago

and at the same time this would give us a native HTTP client.

At present, users can send requests using their favorite client library, but does that mean that we will provide a feature build that includes clients?

tomhoule commented 4 years ago

Yes it should definitely be a feature (on by default or opt-in, I'm not sure). Users should definitely have access to the current API too in my opinion.

h-michael commented 4 years ago

I think that it is a good configuration that there is room for the current user to select the client library by himself. If you do not add a new function with the client, I think that the built-in client can be opt-in.