Getting started with GraphQL on apollo-server-micro ๐
$ git clone https://github.com/shoNagai/apollo-server-micro-boilerplate.git
$ cd apollo-server-micro-boilerplate
$ yarn install
$ yarn dev
type Book {
id: ID!
title: String!
author: String!
}
type Query {
books: [Book!]!
}
$ yarn generate
src/types/graphql.ts
import mockData from '../mocks/book.json';
import { Resolvers } from '../types/graphql';
export const resolvers: Resolvers = {
Query: {
books: () => mockData,
},
};
$ yarn dev