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
Provides ability to work with backend over GraphQL protocol. Advanced configuration for apollo client described below.
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 preconfigure options, such as uri
and credentials
.
Noop implementation by default. Used, when other types of authentication applied.
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({});