This package is deprecated, please use @lenne.tech/ng-base instead. It contains all the features of @lenne.tech/ng-graphql-client and many more.
Angular GraphQL Client by lenne.Tech is a library for Angular to communicate with a server via GraphQL using Apollo Angular.
To use this library, an Apollo Server is required. If you don't use a server with such an API yet, we recommend our lenne.Tech Nest Server, which you can set up conveniently with our Starter.
This extension contains the following features:
- GraphQL service and elements for easy communication with GraphQL API (via Models)
- Standard Model with methods for mapping, cloning and comparing models
- Basic User Model with basic rights handling
- Authentication service for user registration
- Loading Service for the subscription of loading processes
- Storage Service for comfortable saving of data in local storage
- and much more
Installation
cd path/to/your/angular-project
npm i @lenne.tech/ng-graphql-clientIntegration in your App Module (src/app/app.module.ts):
import { GraphQLModule } from '@lenne.tech/ng-graphql-client'
@NgModule({
imports: [
GraphQLModule.forRoot({
apiUrl: 'https://url.to-your.domain/api',
version: 'versionForLocalStorageKeys',
prefix: 'prefixForLocalStorageKeys'
})
],
})This project was generated with Angular CLI version 11.0.4.
Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.
Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.
Run ng test to execute the unit tests via Karma.
Run ng e2e to execute the end-to-end tests via Protractor.
To get more help on the Angular CLI use ng help or go check out the Angular CLI Overview and Command Reference page.
npm run packAfterwards, the package can be included in an Angular project as follows in the package.json on a test basis:
{
"dependencies": {
"@lenne.tech/ng-graphql-client": "file:/PATH_TO_PROJECT/ng-graphql-client/dist/graphql-client/lenne.tech-ng-graphql-client-0.1.7.tgz"
}
}Update version in projects/graphql-client/package.json and projects/graphql-client/package-lock.json.
After that, the new package can be published as follows:
npm run publish