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