anthowm / graphqlpetapi-frontend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Graphql Pet api Frontend

Graphql Apollo Client example + angular-ngrx-material-starter

About the Pet api Frontend

The Pet api frontend is an example about angular + graphql apollo client + angular-ngrx-material-starter. This example has all the features of angular-ngrx-material-starter + some added listed below (You can checkout for all features https://github.com/tomastrajan/angular-ngrx-material-starter).

New Features

  • Graphql Apollo Client
  • Codegen apollo client services for consume the pet api.
  • Authentication jwt(log in)
  • Create Pet
  • Read Pet
  • Update Pet
  • Delete Pet
  • 404 / 401 components
  • Infinite Scroll
  • Filter for pet search

Demo

You can check a demo here https://petapidemo.firebaseapp.com (The images are not saved to avoid problems but in local it works).

Getting started

Prerequisites

  • Node
  • Angular Cli

Clone project

git clone {repository-URL}

Run locally

  • npm install
  • npm run start
  • Go to http://localhost:4200/

Codegen your graphql api

  • You need a copy of you schema server in schema.graphql
  • You need .graphqlconfig.yml
  • You need codegen.yml here you can change the config of where generate your services and where get the queries and mutations files.
  • You need queries or mutations with .graphql extensions for codegen the services (In this project queries/mutations are in src/app/graphql and the generated services are in /src/app/generated).
  • For generate the services you should use npm run graphql

Considerations

About

License:MIT License


Languages

Language:TypeScript 78.9%Language:HTML 14.7%Language:CSS 5.2%Language:JavaScript 1.2%