Updated graphql

This commit is contained in:
thomashii 2021-07-17 13:05:34 +08:00
parent 16565c26cd
commit 5c4eded653
11 changed files with 32 additions and 70 deletions

6
CHANGELOG.md Normal file
View file

@ -0,0 +1,6 @@
# Change Log
## 1.0.0
* Changed to use `angel3` packages
* Updated to support NNBD

View file

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2016 angel-dart Copyright (c) 2021 dukefirehawk.com
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View file

@ -1,60 +1,37 @@
[![The Angel Framework](https://angel-dart.github.io/assets/images/logo.png)](https://angel-dart.dev) # Graphql Starter Application for Angel3 framework
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/angel_dart/discussion) This is a graphql starter application for [Angel3 framework](https://pub.dartlang.org/packages/angel3_framework) which is a full-stack Web framework in Dart.
[![Pub](https://img.shields.io/pub/v/angel_framework.svg)](https://pub.dartlang.org/packages/angel_framework)
[![Build status](https://travis-ci.org/angel-dart/framework.svg?branch=master)](https://travis-ci.org/angel-dart/framework)
![License](https://img.shields.io/github/license/angel-dart/framework.svg)
**A polished, production-ready backend framework in Dart.**
*Note: This repo is an application boilerplate ,and not the underlying framework library.*
-----
## About
Angel is a full-stack Web framework in Dart. It aims to
streamline development by providing many common features
out-of-the-box in a consistent manner.
With features like the following, Angel is the all-in-one framework you should choose to build your next project:
* [GraphQL Support](https://github.com/angel-dart/graphql)
* [PostgreSQL ORM](https://github.com/angel-dart/orm)
* [Dependency Injection](https://docs.angel-dart.dev/guides/dependency-injection)
* And [much more](https://github.com/angel-dart)...
## Installation & Setup ## Installation & Setup
Once you have [Dart](https://www.dartlang.org/) installed, bootstrapping a project is as simple as running a few shell commands: 1. Download and install [Dart](https://dart.dev/get-dart).
Install the [Angel CLI](https://github.com/angel-dart/cli): ### Development
```bash 1. Run the following command to start Angel3 server in dev mode to *hot-reloaded* on file changes:
pub global activate angel_cli
```
Bootstrap a project:
```bash
angel init hello
```
You can even have your server run and be *hot-reloaded* on file changes:
```bash ```bash
dart --observe bin/dev.dart dart --observe bin/dev.dart
``` ```
Next, check out the [detailed documentation](https://docs.angel-dart.dev/v/2.x) to learn to flesh out your project. 2. Modify the code and watch the changes applied to the application
## Examples and Documentation ### Production
Visit the [documentation](https://docs.angel-dart.dev/v/2.x)
for dozens of guides and resources, including video tutorials,
to get up and running as quickly as possible with Angel.
Examples and complete projects can be found 1. Run the following command:
[here](https://github.com/angel-dart/examples-v2).
```bash
dart bin/prod.dart
```
You can also view the [API Documentation](http://www.dartdocs.org/documentation/angel_framework/latest). 2. Run as docker. Edit and run the provided `Dockerfile` to build the image.
There is also an [Awesome Angel :fire:](https://github.com/angel-dart/awesome-angel) list. ## Resources
Visit the [Developer Guide](https://angel3-docs.dukefirehawk.com/guides) for dozens of guides and resources, including video tutorials, to get up and running as quickly as possible with Angel3.
Examples and complete projects can be found [here](https://github.com/dukefirehawk/angel3-examples).
You can also view the [API Documentation](https://pub.dev/documentation/angel3_framework/latest/).
There is also an [Awesome Angel :fire:](https://github.com/dukefirehawk/angel3-awesome) list.

View file

@ -2,7 +2,3 @@ include: package:pedantic/analysis_options.yaml
analyzer: analyzer:
strong-mode: strong-mode:
implicit-casts: false implicit-casts: false
linter:
rules:
- unnecessary_const
- unnecessary_new

View file

@ -1,6 +1,4 @@
/// Your very own web application! /// Your very own web application!
library angel;
import 'dart:async'; import 'dart:async';
import 'package:angel3_framework/angel3_framework.dart'; import 'package:angel3_framework/angel3_framework.dart';
import 'package:file/local.dart'; import 'package:file/local.dart';

View file

@ -1,6 +1,3 @@
/// Configuration for this Angel instance.
library angel.src.config;
import 'package:angel3_configuration/angel3_configuration.dart'; import 'package:angel3_configuration/angel3_configuration.dart';
import 'package:angel3_framework/angel3_framework.dart'; import 'package:angel3_framework/angel3_framework.dart';
import 'package:angel3_jael/angel3_jael.dart'; import 'package:angel3_jael/angel3_jael.dart';

View file

@ -1,6 +1,3 @@
/// Custom plugins go here.
library angel.src.config.plugins;
import 'dart:async'; import 'dart:async';
import 'package:angel3_framework/angel3_framework.dart'; import 'package:angel3_framework/angel3_framework.dart';

View file

@ -1,5 +1,3 @@
library angel.src.routes.controllers;
import 'dart:async'; import 'dart:async';
import 'package:angel3_framework/angel3_framework.dart'; import 'package:angel3_framework/angel3_framework.dart';

View file

@ -1,6 +1,3 @@
/// This app's route configuration.
library angel.src.routes;
import 'package:angel3_framework/angel3_framework.dart'; import 'package:angel3_framework/angel3_framework.dart';
import 'package:angel3_static/angel3_static.dart'; import 'package:angel3_static/angel3_static.dart';
import 'package:file/file.dart'; import 'package:file/file.dart';
@ -10,8 +7,8 @@ import 'graphql/graphql.dart' as graphql;
/// Put your app routes here! /// Put your app routes here!
/// ///
/// See the wiki for information about routing, requests, and responses: /// See the wiki for information about routing, requests, and responses:
/// * https://github.com/angel-dart/angel/wiki/Basic-Routing /// * https://angel3-docs.dukefirehawk.com/guides/basic-routing
/// * https://github.com/angel-dart/angel/wiki/Requests-&-Responses /// * https://angel3-docs.dukefirehawk.com/guides/requests-and-responses
AngelConfigurer configureServer(FileSystem fileSystem) { AngelConfigurer configureServer(FileSystem fileSystem) {
return (Angel app) async { return (Angel app) async {
// Typically, you want to mount controllers first, after any global middleware. // Typically, you want to mount controllers first, after any global middleware.
@ -31,7 +28,7 @@ AngelConfigurer configureServer(FileSystem fileSystem) {
// //
// Read the following two sources for documentation: // Read the following two sources for documentation:
// * https://medium.com/the-angel-framework/serving-static-files-with-the-angel-framework-2ddc7a2b84ae // * https://medium.com/the-angel-framework/serving-static-files-with-the-angel-framework-2ddc7a2b84ae
// * https://github.com/angel-dart/static // * https://pub.dev/packages/angel3_static
if (!app.environment.isProduction) { if (!app.environment.isProduction) {
var vDir = VirtualDirectory( var vDir = VirtualDirectory(
app, app,
@ -47,7 +44,7 @@ AngelConfigurer configureServer(FileSystem fileSystem) {
// Set our application up to handle different errors. // Set our application up to handle different errors.
// //
// Read the following for documentation: // Read the following for documentation:
// * https://github.com/angel-dart/angel/wiki/Error-Handling // * https://angel3-docs.dukefirehawk.com/guides/error-handling
var oldErrorHandler = app.errorHandler; var oldErrorHandler = app.errorHandler;
app.errorHandler = (e, req, res) async { app.errorHandler = (e, req, res) async {

View file

@ -1,6 +1,3 @@
/// Declare services here!
library angel.services;
import 'dart:async'; import 'dart:async';
import 'package:angel3_framework/angel3_framework.dart'; import 'package:angel3_framework/angel3_framework.dart';

View file

@ -1,9 +1,8 @@
name: angel name: angel
description: An app that's going to be amazing pretty soon. description: A graphql starter application for Angel3 framework
publish_to: none publish_to: none
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'
homepage: https://github.com/dukefirehawk/boilerplates
dependencies: dependencies:
angel3_auth: ^4.0.0 angel3_auth: ^4.0.0
angel3_configuration: ^4.0.0 angel3_configuration: ^4.0.0