Skip to content

Commit

Permalink
Fix GitHub Actions #65 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
alexis-opolka committed Jan 29, 2024
1 parent b08e38f commit 07ddbf1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/app/api/github-requests/projects/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ import { NextResponse } from "next/server";
import { ApolloClient, InMemoryCache, gql, ApolloQueryResult, createHttpLink } from '@apollo/client';
import { setContext } from '@apollo/client/link/context';

const GITHUB_TOKEN = process.env.GITHUB_ACCESS_TOKEN;
let GITHUB_TOKEN: string | undefined = "";

try {
GITHUB_TOKEN = process.env.GITHUB_ACCESS_TOKEN;
} catch(error) {
GITHUB_TOKEN = process.env.TOKEN_GITHUB;
}


// Create the http link
const httpLink = createHttpLink({
Expand Down Expand Up @@ -30,7 +37,7 @@ export const client = new ApolloClient({
});

export async function GET() {
const res: ApolloQueryResult<never> = await client
const res: ApolloQueryResult<never> | ApolloQueryResult<unknown> = await client
.query({
query: gql`
query{
Expand Down

0 comments on commit 07ddbf1

Please sign in to comment.