(yet another (battle tested)) GraphQL client

As part of our (shamelessly plugged) PRODUCT HUNT LAUNCH :point_right: https://www.producthunt.com/posts/meeshkan-ui-test-recorder :point_left:, we’re open sourcing parts of our PS stack :confetti_ball:

The first bit is here, which has been used to make millions of GraphQL requests in production.

It is a different approach than a lot of other graphql libraries but we’ve found that the approach is ergonomic and scalable across the team. I hope it works for y’all as well.

And, back to my shameless plug, I hope you can check out our PH launch! Our stack is certifiably 68.5% PureScript, so the community has been a big help getting there :smiley:

2021-05-20 (3)

15 Likes

Looks like it utilizes simple-json meaning you could write your own read/write JSON instances for types beyond the example of String, Array, Record, yes?

1 Like

Yup! We do lots of that at Meeshkan. For example, the following snippet is from our codebase. TestRunStatus is a custom type.

instance graphqlTestRunCreate ::
  GraphQL TestRunCreate """
  mutation($releaseId: ID!, $status: String!, $length: String!, $ciRun: String) {
    testRunCreate(
      data: {
        release: { connect: { id: $releaseId } }
        status: $status
        testLength: $length
        ciRun: $ciRun
      }
    ) {
      id
    }
  }
""" ( releaseId :: String
    , status :: TestRunStatus
    , length :: String
    , ciRun :: Maybe String
    ) ( testRunCreate :: { id :: String } )
1 Like

I think this may be a good example to add then: simple query vs. “complex” query.

1 Like

thanks for the awesome information.