From c041945347075dacd0a676e6fbd2a521c9830e80 Mon Sep 17 00:00:00 2001 From: Roman Kyslyy Date: Tue, 2 Jul 2024 17:48:43 +0300 Subject: [PATCH] Fix match --- web/app/sample-protected-route/lib/ui/Greet.tsx | 7 +++++-- web/middleware.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/web/app/sample-protected-route/lib/ui/Greet.tsx b/web/app/sample-protected-route/lib/ui/Greet.tsx index febebc8..c50da71 100644 --- a/web/app/sample-protected-route/lib/ui/Greet.tsx +++ b/web/app/sample-protected-route/lib/ui/Greet.tsx @@ -1,9 +1,12 @@ 'use client' -import * as GQL from '../../../../../common/graphql/generated/gql' +import { useMutation } from '@apollo/client' +import { graphql } from '@common/generated/graphql' + +const greetMutation = graphql('mutation Greet($name: String!) {\n greet(name: $name) {\n greeting\n }\n}') export const Greet = () => { - const [greet, { data: greetResult, loading }] = GQL.useGreetMutation() + const [greet, { data: greetResult, loading }] = useMutation(greetMutation) return (
diff --git a/web/middleware.ts b/web/middleware.ts index 31d8468..6af5741 100644 --- a/web/middleware.ts +++ b/web/middleware.ts @@ -6,5 +6,5 @@ export default NextAuth(authConfig).auth export const config = { // require login for these paths // https://nextjs.org/docs/app/building-your-application/routing/middleware - matcher: ['/sample/:path'], + matcher: ['/sample-protected-route/:path'], }