How to use the apollo-angular.ApolloModule.withClient function in apollo-angular

To help you get started, we’ve selected a few apollo-angular examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bkinsey808 / graphql-fullstack-seed / client / src / app / app-module / app.module.ts View on Github external
import { AppComponent } from './components/app.component';
import { getClient } from './client';
import { UsersComponent } from './components/users/users.component';


@NgModule({
  bootstrap: [ AppComponent ],

  // modules go here
  imports: [
    BrowserModule,
    HttpModule,
    AppRoutingModule,
    MaterialModule,
    BrowserAnimationsModule,
    ApolloModule.withClient(getClient),
  ],

  // services go here
  providers: [ AuthService ],

  // components go here
  declarations: [
    AppComponent,
    UsersComponent
  ],

})

export class AppModule { }
github Urigo / WhatsApp-Clone-GraphQL-Angular-Material / src / app / app.module.ts View on Github external
// rest
import { provideClient } from './apollo';

@NgModule({
  declarations: [
    AppComponent,
    HomePageComponent,
  ],
  imports: [
    // 3rd party modules
    BrowserModule,
    BrowserAnimationsModule,
    ReactiveFormsModule,
    MaterialModule,
    FlexLayoutModule,
    ApolloModule.withClient(provideClient),
    // our modules
    AppRoutingModule,
    AuthModule,
    SharedModule,
    ChatsModule,
    CallsModule,
    ContactsModule,
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
github apollographql / apollo-angular / examples / hello-world / src / app / app.module.ts View on Github external
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { ApolloModule } from 'apollo-angular';

import { AppComponent } from './app.component';
import { getClient } from './client';

@NgModule({
  declarations: [
    AppComponent,
  ],
  imports: [
    BrowserModule,
    FormsModule,
    ReactiveFormsModule,
    // Define the default ApolloClient
    ApolloModule.withClient(getClient),
  ],
  bootstrap: [AppComponent],
})
export class AppModule {}
github robzhu / graphql-hackathon / AngularApollo / src / app / graphql / apollo.module.ts View on Github external
import { ApolloModule } from 'apollo-angular';
import { ApolloClient, createNetworkInterface } from 'apollo-client';

export const ApolloModuleInst = ApolloModule.withClient(getClient);

export function getClient() {
  return new ApolloClient({
    networkInterface: createNetworkInterface({
      uri: 'http://localhost:5000',
      opts: {
        credentials: 'same-origin',
      },
    }),
    dataIdFromObject: o => o['id'],
  });
}

apollo-angular

Use your GraphQL data in your Angular app, with the Apollo Client

MIT
Latest version published 3 days ago

Package Health Score

90 / 100
Full package analysis