Skip to content

Instantly share code, notes, and snippets.

@lucasreta
lucasreta / vanilla-spa-index.html
Last active December 30, 2020 14:23
vanilla-spa
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Welcome | App Manual</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<header>
@lucasreta
lucasreta / graphql-clients-benchmark.md
Created May 26, 2021 04:57 — forked from oddlyfunctional/graphql-clients-benchmark.md
Comparison between GraphQL clients

Client-side GraphQL

graphql_ppx

Let's first analyze how to write the queries. I experimented the graphql_ppx with a few different features (nullable and non-nullable variables, fragments, convert response into record automatically). The type safety is very neat, both the input variables and the response have specific types (no Js.Json.t!), and the queries/mutations are validated against the schema! This makes it really easy to write queries, although I worry about integrating new versions of the schema since the repos are separated (we should probably re-fetch the schema as part of the CI).

As for the drawbacks, there are not many:

  • The ppx really messes up my language server sometimes.
  • I haven't tried a lot but I couldn't find easily a way to use refmt to format the queries.
  • I couldn't find anything about custom directives, the lack of which would prevents us from using some features from the GraphQL clients (for example, managing local state using Apollo's @client directive).
  • I haven't
@lucasreta
lucasreta / cloudSettings
Last active April 8, 2022 15:58
VS Code Settings
{"lastUpload":"2022-04-08T15:57:57.709Z","extensionVersion":"v3.4.3"}