Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 631 Bytes

README.md

File metadata and controls

34 lines (24 loc) · 631 Bytes

Next js app with graphql api route

Apollo server micro with type-graphql

Getting Started

First, run the development server:

npm run dev
# or
yarn dev

Generated hooks and components for GraphQL api calls

for example query:

gql`
  query Posts {
    posts {
      id
      title
    }
  }
`;

will produce hook const { data, loading, error } = usePostsQuery();

yarn build of yarn dev will generate /src/graphql/api.tsx for client side and /src/graphql/api-ssr.tsx for server side automatically

Open http://localhost:3000 with your browser to see the result.