diff --git a/pages/about.tsx b/pages/about.tsx index 760b4348..aa6a42f3 100644 --- a/pages/about.tsx +++ b/pages/about.tsx @@ -295,7 +295,7 @@ export type PricingPageProps = { teamMembers: TeamMemberFragment[] } export const getStaticProps: GetStaticProps = async ( _context ) => { - const { data: teamMembers, error: teamMembersError } = await getTeamMembers() + const { data: teamMembers } = await getTeamMembers() if (!teamMembers) { return { notFound: true } @@ -307,6 +307,5 @@ export const getStaticProps: GetStaticProps = async ( 'We are building a flexible, scalable solution to application delivery.', teamMembers, footerVariant: FooterVariant.kitchenSink, - errors: [...(teamMembersError ? [teamMembersError] : [])], }) } diff --git a/pages/careers/index.tsx b/pages/careers/index.tsx index e63576f8..7bb36a27 100644 --- a/pages/careers/index.tsx +++ b/pages/careers/index.tsx @@ -292,6 +292,6 @@ export const getStaticProps = async () => { 'We are a growing team working on interesting problems in the cloud with Kubernetes, Elixir, Go, and React. We’re always interested in hiring new talent!', footerVariant: FooterVariant.kitchenSink, jobs: jobs || [], - errors: [...(jobsError ? [jobsError] : [])], + errors: [...(jobsError ? [jobsError.message] : [])], }) } diff --git a/src/apollo-client.ts b/src/apollo-client.ts index d9477aba..1459314d 100644 --- a/src/apollo-client.ts +++ b/src/apollo-client.ts @@ -1,16 +1,30 @@ -import { ApolloClient, InMemoryCache } from '@apollo/client' +import { ApolloClient, ApolloLink, InMemoryCache } from '@apollo/client' +import { HttpLink } from '@apollo/client/link/http' +import { RetryLink } from '@apollo/client/link/retry' + +const pluralRetryLink = new RetryLink() + +const pluralHttpLink = new HttpLink({ uri: 'https://app.plural.sh/gql' }) +const pluralLink = ApolloLink.from([pluralRetryLink, pluralHttpLink]) const client = new ApolloClient({ - uri: 'https://app.plural.sh/gql', + link: pluralLink, cache: new InMemoryCache(), }) const directusToken = process.env.DIRECTUS_ACCESS_TOKEN -export const directusClient = new ApolloClient({ +const directusRetryLink = new RetryLink() + +const directusHttpLink = new HttpLink({ uri: `https://directus.plural.sh/graphql${ directusToken ? `?access_token=${directusToken}` : '' }`, +}) +const directusLink = ApolloLink.from([directusRetryLink, directusHttpLink]) + +export const directusClient = new ApolloClient({ + link: directusLink, cache: new InMemoryCache(), })