Skip to content

📋 Nx monorepo with angular app using graphql to query a Nest backend

Notifications You must be signed in to change notification settings

AndrewJBateman/nx-angular-graphql

Repository files navigation

⚡ Nx Angular GraphQL

  • Nx monorepo with Angular app to display/add tasks from a NestJS backend API using Apollo GraphQL
  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

📄 Table of contents

📚 General info

  • Nx workspace for both front and backends
  • GraphQL typed schema used with code-generator to autogenerate frontend code
  • Apollo Client stores the results of its GraphQL queries in a normalized, in-memory cache using the 'InMemoryCache' class
  • Data-access library used to handle communication with the backend.
  • Feature Tasks library with container components for displaying task data.

📷 Screenshots

Frontend screenshot

📶 Technologies

💾 Setup

  • Install dependencies using npm i
  • Run nx dep-graph to see a diagram of the dependencies of the project.
  • Run npm start api for a backend dev server. View GraphQL playground at http://localhost:3333/graphql
  • Run npm start nx-angular-graphql for a frontend
  • Run npm run lint to lint test entire client-side codebase using ESLint. All files pass.
  • Run nx build nx-angular-graphql` to generate a build file

🔧 Testing

  • tba

💻 Code Examples

  • schema.graphql allTasks query and addTask mutation
type Task {
  id: Int!
  name: String
  deadline: String
  hours: Int
}

type Query {
  allTasks: [Task]
}

type Mutation {
  addTask(name: String, deadline: String, hours: Int): Task
}

🆒 Features

  • monorepo organised libraries etc. makes for tidier code
  • GraphQL interface

📋 Status, Testing & To-Do List

  • Status: Working
  • Testing: unit and end-end tests not completed
  • To-Do: change deadline from simple string to a Date, change random image for icon? add detail to task?

👏 Inspiration/General Tools

📁 License

  • This project is licensed under the terms of the MIT license.

✉️ Contact