Hey everyone. I’ve finally found some time to play around with Graphql on a fun project. Postgraphile just rocks hard since it turns my Postgres DB automatically into a Graphql server. Now I’m still unsure what to use on the client side though. Apollo is just too much and since I’m storing results in aurelia-store I can keep track of caching and co by myself. So far all I use is the aurelia-fetch-client. What are you using?
Unfortunately, I don’t have any experience in this field but not bad to see the following link:
thx @HamedFathi, I’ve seen this and a few other of the top results from a google search. In general I think most clients are trying to do too much yet don’t do what is the point of all, namely a typesafe/non-string way to build up a query, which would be what I’m looking for specifically. Otherwise a classic fetch request is more than enough.
Seems you want to write new one
Well … I hoped I’d not have to
I was already thinking with something along the lines of Schemats to forward generate schema interfaces and then a small utility to generate the resulting query based on a chainable api or the sorts. Of course this could also somehow automatically interact with Aurelia Store, but I think you see the problem at hand. The soon you start thinking about something it immediately explodes in size and scope
I’ve started exploring this space as well. Since I’m big on .NET too I think something along the lines of NSwag for GraphQL would be awesome. Note that I haven’t looked to see if such a thing exists already.
I’ve just found https://github.com/dotansimha/graphql-code-generator which also looks definitely interesting
I started looking into that too with NestJS on the backend and they use Apollo Client with their built in lib. I asked if anyone was interested on the subject a few weeks ago in this discourse, there’s print screen there too.
Also the lib I made, Aurelia-Slickgrid also supports GraphQL, for that I use a small lib graphql-query-builder to create the GraphQL query with the column defined in the grid. So I plan to use all of that in a personal project, that would include the following
- NestJS (NodeJS backend framework)
- NestJS GraphQL plugin (Apollo Client)
- NestJS MongoDB plugin
- if you want to use PostGres, you can also use NestJS TypeORM
- Aurelia-Slickgrid (datagrid, with GraphQL support and totally out of subject, I added Excel Export feature last week)
- OAuth2 with NestJS/Aurelia
The POC is done with OAuth2, I just have to finalize couple of things like adding user roles (regular/admin). I was about to make it all public if that is of interest.
I know it’s not exactly your question but it’s kinda related and might be of interest.
There are a lot of things remotely touching this topic so thanks for sharing your stack.
Yep I’ve seen the other topic about Nest.js I just didnt have the need for such a beast yet since my Express combo treated me well so far.
@zewa666 As you probably might have guessed, I’ve worked with GraphQL quite a bit over the last year and a bit. I’m using it on a few Aurelia projects, a few of them open source. The GraphQL implementation I am using these days is Apollo Client and Apollo Server. What you get out of the box with these two which have become the standard is really unrivalled.
If you are after something simple from a client perspective, graphql.js is a great option. Worth point out that I am using Apollo Client with Aurelia Store. It might seem a bit redundant to use both as Apollo Client essentially is a request client and store implementation all rolled into one. However, I am not always just dealing with a GraphQL API. In this open source cryptocurrency decentralised exchange Steem Engine I am leading and building (in Aurelia) I am using Aurelia Store, Firebase, a couple of API endpoints that return JSON and using GraphQL for some data as well.
I have another project on GitHub which is private, it’s a side project I’ve been building on and off for year and a half, I can invite you to the repository if you want to see Apollo Client and Aurelia Store being used together again. This project is more straightforward in that GraphQL is the only data source. I just prefer working with Aurelia Store, so I use them together.
Of course I started with your samples I found first. Also as you note while you can use it with the Store Plugin it just like with Redux, it feels a bit weird in my opinion. But you are right its one of the more popular clients nowadays as it seems so worth giving it a second try with my next fun project
I’d love if you wrote a blog post about your architecture for that app, especially the relationship between Apollo Client and Aurelia Store.
That could be a really nice addition to the official Aurelia Store docs as well.
@davidlav Absolutely, David. I can write something up. I might be able to get a start over the weekend.