July 22, 2021

Connecting Svelte to Apollo

Introduction Well, the weather has been so nice that I’ve been neglecting it on the weekends while BBQing and making pizzas, but I think it’s time to start working on the client side. Now that we’ve got the server side working, let’s make a client that connects to it. Apollo’s official website says that they don’t know any client other than React, which is sad, but I’ll try to make a TODO app client with Svelte. Read more

July 10, 2021

Update Tasks with Mutaions

Introduction last time was search by id form the task list. This time, I am going to update the liset. It’s called Mutation, which is a cool name in the GraphQL community :D Code const { ApolloServer, gql } = require('apollo-server'); const typeDefs = gql` type Task { id: ID! name: String! isActive: Boolean! createdAt: Int updatedAt: Int owner: String } type Query { tasks: [Task] task(id: ID!): Task } # ❶ type Mutation { addTask(name: String! Read more

July 4, 2021

Query to Search for an Item with Apollo

Introduction Last time was to get list of todo from Apollo. This time I am going to add task search functionality by id. Code const { ApolloServer, gql } = require('apollo-server'); const typeDefs = gql` type Task { id: ID! name: String! isActive: Boolean! createdAt: Int updatedAt: Int owner: String } type Query { tasks: [Task] task(id: ID!): Task # ❶ } `; const tasks = [ { id: 1, name: "Soak in an Onsen", isActive: true}, { id: 2, name: "Sing Karaoke", isActive: false}, { id: 3, name: "See cherry blossom", isActive: true}, ] const resolvers = { Query: { tasks: () => tasks, task (parent, args, context, info) { // ❷ const { id } = args; return context. Read more

June 27, 2021

Simple list view with Apollo

Introduction I’ve been playing around with GraphQL lately and that’s fun. After playing with GraphQL for a while, I thought I’d write about it in a series of articles. The best way to get started with GraphQL now is to start with these two great sites to grasp the concept. Introduction to GraphQL The Fullstack Tutorial for GraphQL However, as soon as you follow these tutorials, you will start setting up the database and ORM. Read more

© narutaro 2021

Powered by Hugo & Kiss with tweaks.