In this tutorial, I'll be showing you how to hand file uploads in GraphQL by building a fullstack app. The tutorial will be divided into two main sections: building the GraphQL API and the frontend app. The GraphQL API will be built using Apollo Server ... more
Now that our frontend application is running, the next step is to set up the client to communicate with the server. We’ll make use of the apollo-boost package to achieve this. The package provides a client for connecting to the GraphQL backend. Let’s ... more
Now we’ll create a component to render the data in the 8base backend. This component will handle the fetching of data using GraphQL queries and will render the fetched data accordingly. To get started, create a folder components in the /src directory. ... more
Let’s create the Questions component, open the src/components/questions/index.js file and update the file with the following: // src/components/questions/index.js import React, { useState } from "react"; import gql from "graphql-tag"; ... more
Create a folder called question within the src/components directory and a file index.js within it. Open the file and copy the following into the file: //src/components/question/index.js import React, { useState } from "react"; const Question ... more
After two years of wait, the critically acclaimed final season of Game of Thrones has come and gone leaving most viewers half full and discontent. There was always that feeling that the final season of such a great show had to end with a bang that will ... more
We’re going to make use of some new packages for creating questions. Open a terminal in your project folder and run the following command: npm install react-modal react-tagsinput react-toastify 8base/file-input Let’s go through the purpose of each package: ... more
Vue.js is known as a "progressive framework for building user interfaces". There's a lot to unpack in this simple statement. It's easy to get started with Vue.js, with a minimal feature set, and then layer in more of the framework as you need ... more
Create a folder named question-modal within the src/components directory and a file index.js within it. Open the file and update it with the snippet below: import React from "react"; import Modal from "react-modal"; import QuestionForm ... more
To get started, we will use create-react-app to bootstrap our application. To create the application using the create-react app CLI, run: npx create-react-app 8base-quizapp If you noticed, we used npx rather than npm. npx is a tool intended to help round ... more
This is a continuation on the series i’ve been doing on GraphQL Actions. In the last post on this series we worked on a Deep Dive into Queries. This time, we will take a closer look at Mutations. There’s a lot of similarities in the way GraphQL Queries ... more
JSX is a great tool because it has so much flexibility. There are many ways to achieve the same thing. For this reason, it can be confusing for new developers when they see different tactics for defining and returning JSX elements. Let's take a look ... more
JSX is the templating language for React. JSX is also one of the main reasons why devs say they dislike React at first. As with all new tools, there will be a learning curve. JSX is no different. I am a big believer that learning JSX will make you a ... more
Most of the time, we use CSS media queries to handle responsive, screen size changes to layout our content differently. However, there are times where CSS media queries alone isn't sufficient for that. We need to handle the responsiveness in our code. ... more
A few months ago, I started live-coding and streaming on Twitch. It was an experiment to get closer to the community and give back to let people see my coding/writing/editing process. I wanted to show off all the things I do when building scotch.io in ... more
In the previous article, I gave an Introduction to Storybook and how it can be used to organize and build JavaScript components. Storybook is a UI library that can be used to document components. In this article, I’ll be explaining how to build an interactive ... more
I wanted to deploy a simple demo node app the other day using Now, and I got into a lot of difficulties and gotchas, with little help from the official docs. If you are in my shoes, this is for you, otherwise, read on to find out how to deploy a node ... more
What are Closures? If you write code in JavaScript it's quite likely you have come across the term closure , which is a useful yet often confusing concept. But just what is a closure? A closure may be described as a combination of a function and the lexical ... more
Netlify is one of the best places to deploy an application or a website today. There is no need to manage a server, NGINX, certificates, or scaling due to high traffic. While it is first thought of as a place to deploy your JAMstack site, it can also ... more
Components are the building blocks of React Applications, and each is a JavaScript function. These components comprise of Parent and Child components. Data is passed from parent to child through what is called Props. Props are simply arguments to these ... more
A custom hook is a JavaScript function with a unique naming convention that requires - the function name to start with use and the function may call other Hooks The whole idea behind custom hooks is just so that we can extract component logic into reusable ... more
Cascading Style Sheet(CSS) is used for creating aesthetically good looking websites. CSS are styling rules that are applied to a web page to make it look beautiful. Whenever a web page is being displayed, the browser renders the webpage alongside with ... more
An upcoming Vue update was set to have classes implemented. In React and Angular, we can create components using JavaScript classes. Some people prefer this way of component creation as it can lead to better readability. It can be a confusing tool though ... more
Generally, there are two ways of writing code: Imperatively/Declaratively and two ways of fetching Data: Synchronously/Asynchronously. We are more convenient with making requests imperatively using fetch or libraries like axios. With async-await , we ... more
Angular's 8.0.0 release is here! This is a major release that brings some nice features. For the official blog post, check the official Angular post on Medium. Let's talk about some of the changes. Updating to Angular v8 There's a great tool to help ... more
Since the advent of module bundling, we thought all our asset request got solved because the bundler hands us a single bundle that represents everything. We just shove this bundle right into our app and that’s all. No that’s not all. If your app falls ... more
A number of web applications and sites rely on third-party APIs and services for data. In this React challenge, we will learn to make an API request to a third party API service. This is an open API. Hence, it requires no authentication. For this challenge, ... more
Don’t just get assets from your resources pool and dump it right into your web pages. There is always a high chance that SVGs, images, fonts, videos, and every kind of asset you can think of come in their raw form and are poorly optimized for delivery. ... more
There is a kind of animations that has not stopped increasing its presence in the most modern and original websites: the animations based on the scroll event of Javascript. This trend literally exploded when the parallax effects appeared, and since then ... more
GatsbyJS is a React-based static site generator powered by GraphQL. It makes it possible for you to code and develop your site, while Gatsby transforms it into a directory with a single HTML file with all your static assets. On it’s own Gatsby is fast ... more