Tag: next.js
-
How to implement pagination in Next.js 13 using the App Router and Server Components
1 I started building a Next.js frontend for a WordPress website, using the App Router and GraphQL plugin to fetch data from WordPress. The homepage is all set up to display the latest posts, and it’s a server component. import PostCard from "./components/post"; import styles from ‘./page.module.scss’ interface Post { title: string; date: string; excerpt:…
-
Show filtered content related to an object by the value of an input JSX element
0 Say i have an input element that filters categories on a given value. That category object has name, slug, posts, so what I want to do is to show only the posts that are related to that category as the input element in a Search function receives a value . In the console I…
-
GraphQl Code Generator doesn’t generate graphql() properly in Next.js
-1 I use GraphQL in next.js project and generate types for query. But code generator doesn’t generate properly. it’s says "The query argument is unknown! Please regenerate the types." in gql.ts file. Here you can see type error: Code generator config: import {CodegenConfig} from ‘@graphql-codegen/cli’ const config: CodegenConfig = { schema:"https://localhost:4000/graphql", documents: [‘components/**/*.tsx’, ‘app/**/*.tsx’], ignoreNoDocuments:…
-
Create a filtering function in react
0 I want to create a filtering function that trigger when receiving a input value event in react useState but i do not see is doing anything when I start typing in. This is my Search component export function Search({categories, onSearch}){ const [searchText, setSearchText] = useState(”); const filterCategories = () => { const filteredCategories =…
-
Create a search bar function to filter Graphql data
0 I have been working on a project using Nextjs that fetches data from Graphql api I have defined categories and posts models that work well when filtering by Category. I want to implement an input search bar function but i do not know how to associate it with the Graphql api I have searched…
-
Application error: a client-side exception has occurred (see the browser console for more information)
5 Nextjs Blog App Currently seeing: Application error: a client-side exception has occurred (see the browser console for more information). I see the above error when creating a post in deployment on AWS Amplify console and DynamoDB is unable to redirect to post created on submit but I can view the post locally on submit.…