Skip to content

Commit

Permalink
Simplify the graphql path
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-matsui committed Dec 26, 2023
1 parent 3e8a78e commit bcdd407
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ public/robots.txt
public/sitemap*.xml

graphql.schema.json
graphql/graphql.ts
graphql/index.ts
6 changes: 3 additions & 3 deletions app/_lib/hasuraClient.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { GraphQLClient } from "graphql-request";
import { getSdk } from "~/graphql/graphql";
import { getSdk } from "~/graphql";

const HASURA_GRAPHQL_URL = "https://poac.hasura.app/v1/graphql";

export const getHasuraClient = (token: string | null = null) => {
const headers =
token !== null
? {
authorization: `Bearer ${token}`,
}
authorization: `Bearer ${token}`,
}
: undefined;
const client = new GraphQLClient(HASURA_GRAPHQL_URL, {
headers,
Expand Down
2 changes: 1 addition & 1 deletion app/packages/[group]/[name]/_components/pack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Chip, Code, Divider, Link } from "@nextui-org/react";
import ReactMarkdown from "react-markdown";
import remarkGfm from "remark-gfm";
import { format } from "timeago.js";
import { GetPackageByNameAndVersionQuery } from "~/graphql/graphql";
import { GetPackageByNameAndVersionQuery } from "~/graphql";

export function Pack({
pack,
Expand Down
2 changes: 1 addition & 1 deletion app/search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
import NextLink from "next/link";
import { useRouter, useSearchParams } from "next/navigation";
import { useEffect, useState } from "react";
import { SearchPackagesQuery } from "~/graphql/graphql";
import { SearchPackagesQuery } from "~/graphql";
import { PER_PAGE } from "../_lib/constants";

export default function Search() {
Expand Down
2 changes: 1 addition & 1 deletion codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const config: CodegenConfig = {
documents: ["./graphql/**/*.graphql"],
overwrite: true,
generates: {
"./graphql/graphql.ts": {
"./graphql/index.ts": {
plugins: [
"typescript",
"typescript-operations",
Expand Down

0 comments on commit bcdd407

Please sign in to comment.