Stacking Vercel, a GraphQL Apollo Server and React
Introduction Vercel makes it seamless to deploy React single page applications. Given its use of serverless functions however, hosting a GraphQL API using Apollo Server on Vercel is less straightforward. This worked example for Linux demonstrates how it might be done - borrowing code from my earlier Oh-so minimal GraphQL API example with Apollo Server tutorial.
All code can be found on github at my vercel-apollo-server-react repo. The end result of the demo is also hosted on Vercel at vercel-apollo-server-react.
A plain-text issue template for use on Github
When I’m creating a new issue on Github I like to use a template - it just helps me order my thoughts. Here’s the one I copy and paste if the repository maintainer has not provided one:
## Describe the issue ## To reproduce ## Expected behaviour ## Screenshots ## Configuration - OS: - Browser: ## Additional context Plenty more examples in Steve Mao’s github-issue-templates repo.
On metadata in Hugo - or turning tags to keywords
TL;DR How (and why) to add the HTML metadata of keywords, description and canonical link to Hugo’s Cactus Plus theme. All code viewable on my blog repository.
The best being the enemy of the good Before starting a blog I knew I was in considerable danger of spending a year researching blog content management software, not writing a word and eventually shelving the whole project. As my inspiration for starting a blog was Guzey’s Why you should start a blog right now I figured a good heuristic was to use whatever he did.
A no jokes guide to testing a GraphQL API with Jest
Oh-so minimal GraphQL API example with Apollo Server
Port 8080 fail using TiddlyWiki5 and Node on a Raspberry Pi
The Problem There seem a ton of ways to get TiddlyWiki running. I thought I would try the Node.js version on a Raspberry Pi. I wanted a set-up so I could leave the Pi online and access the TiddlyWiki on the rest of my home LAN. After following the instructions I got to the last line:
tiddlywiki mynewwiki --listen And I had TiddlyWiki running on the Pi, but couldn’t access on the rest of the LAN.
Forget-me-block: Ethereum Calendar
Introduction As we progress through life’s journey we lose digital information. Who we met, what we talked about, contact details, etc tend to disappear in the digital flux like tears in the rain. Often this happens as we switch providers from Big Tech Corp A to Big Tech Corp B and back again - access is lost to data we have stored in someone else’s stovepipe.
This post details a proof of concept to combat this by hosting a calendar as an Ethereum smart contract.
Avoiding Call Revert Exception Error when accessing Truffle Ganache via Ethers in Node
Introduction My default way of connecting to a local instance of the Ethereum blockchain using Truffle Ganache is via the browser using Metamask. Using ethers to connect via node.js is however a little different. As the Ethers documentation, at time of writing, contains few specific mentions of Truffle (primarily I suspect as the lead developer doesn’t use it), I got a couple of call revert exception errors before I figured out what I was doing wrong.
Forget-me-block: Message Time Store
Research Aim As part of ongoing research into using the Ethereum blockchain for the purpose of data preservation strategies, the aim is to create the following deliverables:
A smart contract that provides notification of previously recorded information, at a predetermined future date, or prompted by a retrieval request. A DApp (Decentralised Application) based around the smart contract above where the user is notified via an interface such as a web browser.
Short, sharp Solidity: pure vs view vs call
Introduction A quick worked example demonstrating the differences between the read-only Solidity elements pure, view and .call() in the Truffle console.
At time of writing I’m using: Truffle v5.1.30 (core: 5.1.30), Solidity v0.5.16 (solc-js), Node v14.4.0, Web3.js v1.2.1, and Ubuntu 20.04 LTS (Regolith flavour).
The smart contract If you want to follow along then after running truffle init in a working folder, copy the following code into contracts/CallDemo.sol:
// SPDX-License-Identifier: Unlicencse pragma solidity ^0.