graphql-client icon indicating copy to clipboard operation
graphql-client copied to clipboard

Object => Query support

Open Disturbing opened this issue 7 years ago • 9 comments
trafficstars

Any plans to have Object => Query support?

class hero {
   string id;
}

client.executeQuery(new Hero {
    id = "1"
});

Disturbing avatar Sep 19 '18 03:09 Disturbing

In fact, we have plans for even a "better" thing. Something like the way people access data from a DbContext but in GraphQL, using LINQ, Select, Where, etc...

deinok avatar Sep 19 '18 08:09 deinok

@Disturbing

Where I work we created a query builder that wraps this library. Its basically like LINQ but for GraphQL queries. Check it out here: https://github.com/Revmaker/Getit

odannyc avatar Nov 05 '18 19:11 odannyc

Hey, @odannyc really interested in this. Would you like to do somehow a merge or let me copy some of the code from Getit?

deinok avatar Nov 05 '18 19:11 deinok

@deinok

I asked my team and we are interested in merging as long as we get a mention back to Carlabs. Let me know of the process you had in mind.

odannyc avatar Nov 05 '18 21:11 odannyc

@odannyc Seems like licences are compatible, I suppose that a mention in the README.md is okey (Logo, WP link and GitHub link).

About the process: v2.0.0 is currently blocked by https://github.com/graphql-dotnet/graphql-client/issues/25 and small API change in GraphQL.Common (To support other thing than JSON)

After the unblock of v2.0.0, we are going to implement a caching and batching systems. That should be v2.1.0

And if everything goes okey, at v2.2.0 we are gona do the merge with your team.

My general idea is to give two options. A really dynamical option (Getit way) and a more compile time option (Something like what is doing EntityFramework exposing things as IQueryables). Nvm, I have to take a closer look to Getit

So, if you accept, we can close this issue, and move the conversation to a newer one dedicated to the merge :)

deinok avatar Nov 06 '18 17:11 deinok

@deinok - Yeah sounds good! If you have any questions or need help understanding Getit let me know and I can help out.

odannyc avatar Nov 06 '18 18:11 odannyc

I'm also working on a similar project. It features building query strings using an expression-based approach (similar to Linq), and provides a Relay client extension.

karrocon avatar Dec 18 '18 13:12 karrocon

Seems like a lot of us are working on this. I created PR #93 that follows EF Core's model. (I came and looked at the issues afterward.)

gregsdennis avatar Jan 31 '19 22:01 gregsdennis

A different take on this: https://github.com/graphql-dotnet/graphql-client/pull/111

pikax avatar May 04 '19 10:05 pikax