@amplicode/react
v1.0.2
Published
Runtime for Amplicode Frontend
Downloads
14
Readme
Amplicode React
Amplicode frontend utils, which are used in generated Amplicode app. Components are extracted in library to avoid code duplication. In case of separate npm package, the same components could be used both in generated app and in addon.
This package installed by default in generated app, so components available in app immediately, without preliminary steps.
In other cases npm
command should be used:
npm install @amplicode/react
Apollo Client
Provides ability to work with backend over GraphQL protocol. Advanced configuration for apollo client described below.
Locale Link
React Admin I18N Provider could be passed as argument in client. In this case server gets the opportunity to return translated error messages.
Http Link
Http link preconfigure options, such as uri
and credentials
.
Auth Link
Noop implementation by default. Used, when other types of authentication applied.
Usage of Amplicode Apollo Client
If package is installed to app, client could be used as:
import { createAmplicodeApolloClient } from "@amplicode/react";
import { ApolloClient, NormalizedCacheObject } from "@apollo/client";
export const apolloClient: ApolloClient<NormalizedCacheObject> = createAmplicodeApolloClient({});