2.0.1 • Published 2 years ago

@ovyn/graphql v2.0.1

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
2 years ago

@Ovyn/Graphql

This library was generated with Angular CLI version 16.1.0.

Usage

Configuration

  1. Module import
GraphqlModule
  1. Factory configuration
  • Store
    function graphqlStoreFactory(
      $store: Store,
      selector: MemoizedSelector<any, any>,
      dispatch: () => TypedAction<any>,
      map: OperatorFunction<any, any>
    ) {
      $store.dispatch(dispatch())
      return $store.select(selector)
        .pipe(
          map
        )
    }
  • Value
    function graphqlFactory(): Observable<GraphqlConfig> {
        return of ({ endpoint: "http://localhost:3000/graphql "})
    }
  1. Service configuration
  • GRAPHQL_CONFIG provider
{
  provide: GRAPHQL_CONFIG,
  useFactory: ($store: Store) => graphqlStoreFactory(
  $store,
  configBaseUriSelector,
  ConfigActions.init,
  map(baseUrl => ({endpoint: `${baseUrl}/graphql`}))
),
  deps: [Store]
}
  • GraphqlService provider
{
    provide: GraphqlService,
    useFactory: ($config: Observable<GraphqlConfig>, $http: HttpClient) => new GraphqlService($config, $http),
    deps: [GRAPHQL_CONFIG, HttpClient]
}
2.0.1

2 years ago

2.0.0

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago