Skip to content

Commit

Permalink
feat: update query after executing mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
patrikzita committed Jan 14, 2024
1 parent 70512db commit b778c57
Show file tree
Hide file tree
Showing 14 changed files with 618 additions and 8 deletions.
2 changes: 1 addition & 1 deletion codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { CodegenConfig } from "@graphql-codegen/cli";

const config: CodegenConfig = {
schema: "http://localhost:3000/api/graphql",
documents: ["./src/**/*.graphql"],
documents: ["./src/**/*.{graphql,gql}"],
ignoreNoDocuments: true,
generates: {
"./src/generated/graphql.ts": {
Expand Down
112 changes: 110 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
},
"dependencies": {
"@apollo/client": "^3.8.8",
"@hookform/resolvers": "^3.3.4",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-navigation-menu": "^1.1.4",
"@radix-ui/react-slot": "^1.0.2",
"@typescript-eslint/eslint-plugin": "^6.18.0",
Expand All @@ -31,14 +34,17 @@
"graphql": "^15.8.0",
"graphql-scalars": "^1.22.4",
"lodash": "^4.17.21",
"lucide-react": "^0.309.0",
"micro": "^9.4.1",
"next": "14.0.4",
"react": "^18",
"react-dom": "^18",
"react-hook-form": "^7.49.3",
"reflect-metadata": "^0.2.1",
"tailwind-merge": "^2.2.0",
"tailwindcss-animate": "^1.0.7",
"type-graphql": "^1.1.1"
"type-graphql": "^1.1.1",
"zod": "^3.22.4"
},
"devDependencies": {
"@graphql-codegen/cli": "^5.0.0",
Expand Down
Binary file modified sqlite.db
Binary file not shown.
11 changes: 11 additions & 0 deletions src/components/layouts/MainNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const ROUTES = {
OFFSET_PAGINATION: "/offset-pagination",
BASED_PAGINATION_WITH_FILTERS: "/pagination-with-filters",
OFFSET_PAGINATION_EXPANDED: "/offset-pagination-expanded",
CREATE_DEAL: "/create-deal",
};

const MainNav = () => {
Expand All @@ -27,6 +28,16 @@ const MainNav = () => {
</NavigationMenuLink>
</Link>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuTrigger>Basics</NavigationMenuTrigger>
<NavigationMenuContent>
<Link href={ROUTES.CREATE_DEAL} legacyBehavior passHref>
<NavigationMenuLink className={navigationMenuTriggerStyle()}>
Mutation - update cache
</NavigationMenuLink>
</Link>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuTrigger>Pagination</NavigationMenuTrigger>
<NavigationMenuContent>
Expand Down
28 changes: 28 additions & 0 deletions src/components/ui/checkbox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import * as React from "react"
import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
import { CheckIcon } from "@radix-ui/react-icons"

import { cn } from "@/lib/utils"

const Checkbox = React.forwardRef<
React.ElementRef<typeof CheckboxPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
>(({ className, ...props }, ref) => (
<CheckboxPrimitive.Root
ref={ref}
className={cn(
"peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
className
)}
{...props}
>
<CheckboxPrimitive.Indicator
className={cn("flex items-center justify-center text-current")}
>
<CheckIcon className="h-4 w-4" />
</CheckboxPrimitive.Indicator>
</CheckboxPrimitive.Root>
))
Checkbox.displayName = CheckboxPrimitive.Root.displayName

export { Checkbox }
Loading

0 comments on commit b778c57

Please sign in to comment.