partial ng12 migration
This commit is contained in:
+28
-28
@@ -9,40 +9,40 @@ import {Apollo, ApolloModule} from 'apollo-angular';
|
||||
import {HttpLink, HttpLinkModule} from 'apollo-angular-link-http';
|
||||
import {DefaultOptions} from 'apollo-client';
|
||||
import {InMemoryCache} from 'apollo-cache-inmemory';
|
||||
import {HttpClientModule} from '@angular/common/http';
|
||||
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
||||
import {HttpClientModule} from "@angular/common/http";
|
||||
|
||||
|
||||
export function app_Init(apollo: Apollo, httpLink: HttpLink) {
|
||||
return async () => {
|
||||
const defaultOptions: DefaultOptions = {
|
||||
watchQuery: {
|
||||
fetchPolicy: 'no-cache',
|
||||
errorPolicy: 'ignore',
|
||||
},
|
||||
query: {
|
||||
fetchPolicy: 'network-only',
|
||||
errorPolicy: 'all',
|
||||
},
|
||||
mutate: {
|
||||
fetchPolicy: 'no-cache',
|
||||
},
|
||||
};
|
||||
|
||||
apollo.createDefault({
|
||||
link: httpLink.create({ uri: 'https://localhost:5001' }),
|
||||
cache: new InMemoryCache(),
|
||||
defaultOptions: defaultOptions,
|
||||
});
|
||||
|
||||
apollo.createNamed('command', {
|
||||
link: httpLink.create({ uri: 'https://localhost:6001' }),
|
||||
cache: new InMemoryCache(),
|
||||
defaultOptions: defaultOptions,
|
||||
});
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve();
|
||||
const defaultOptions: DefaultOptions = {
|
||||
watchQuery: {
|
||||
fetchPolicy: 'no-cache',
|
||||
errorPolicy: 'ignore',
|
||||
},
|
||||
query: {
|
||||
fetchPolicy: 'network-only',
|
||||
errorPolicy: 'all',
|
||||
},
|
||||
mutate: {
|
||||
fetchPolicy: 'no-cache',
|
||||
},
|
||||
};
|
||||
|
||||
apollo.createDefault({
|
||||
link: httpLink.create({ uri: 'https://localhost:5001' }),
|
||||
cache: new InMemoryCache(),
|
||||
defaultOptions: defaultOptions,
|
||||
});
|
||||
|
||||
apollo.createNamed('command', {
|
||||
link: httpLink.create({ uri: 'https://localhost:6001' }),
|
||||
cache: new InMemoryCache(),
|
||||
defaultOptions: defaultOptions,
|
||||
});
|
||||
|
||||
resolve(true);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -13,4 +13,4 @@ export const environment = {
|
||||
* This import should be commented out in production mode because it will have a negative impact
|
||||
* on performance if an error is thrown.
|
||||
*/
|
||||
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
|
||||
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@
|
||||
/***************************************************************************************************
|
||||
* Zone JS is required by default for Angular itself.
|
||||
*/
|
||||
import 'zone.js/dist/zone'; // Included with Angular CLI.
|
||||
import 'zone.js'; // Included with Angular CLI.
|
||||
|
||||
|
||||
/***************************************************************************************************
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
||||
|
||||
import 'zone.js/dist/zone-testing';
|
||||
import 'zone.js/testing';
|
||||
import { getTestBed } from '@angular/core/testing';
|
||||
import {
|
||||
BrowserDynamicTestingModule,
|
||||
|
||||
Reference in New Issue
Block a user