Tag: next.js
-
“Error syncing atom “testQuery__{}” with GraphQL: Failed to parse URL from /graphql undefined” in Next.js + GraphQL + Relay + Recoil environment
0 Although I had to rename the variables and properties, below Next.js + GraphQL + Relay code works fine in my Next.js + Relay environment: const testsQuery = graphql` query TestsQuery { tests { collection { foo bar baz } } } `; const Child => props => { const { foo } = usePreloadedQuery(testsQuery…
-
Why Richtext content is not searchable in hygraph/graphcms?
0 Im try to search content from the query user requested but hygraph not showing the result it only show data if title contains it… export async function getServerSideProps(context) { const { query } = context; const { posts } = await hygraph.request( ` query BlogPostPage($search: String! ){ posts(where:{_search: $search}){ createdAt id slug titile coverPhoto…
-
Generating graphql with pothos and prisma plugin returns null data even though data exists in the database
0 I’m creating a graphql with nextjs using prisma, and pothos. I’ve defined the schema for my table: schema.prisma: model Course { id Int @id @unique @default(autoincrement()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt title String content String published Boolean courseId String cId String Lessons Lesson[] } I’ve added this as my resolver/graphql types: import {…
-
Using Nextje App Routing and project structure
0 I want to start a project with these technologies. This project is about Learning Management System, and it will be a web application. Nextjs, using app directory and new features AntDesign Tailwind GraphQL Apolo or ReactQuery for Caching So My Questions 1- Do you have any ideas or commnets? 2- Do I have any…
-
When when I give my variable name type String! in grafabase query then it says variable is not defined why?
0 here is my query: export const projectsQuery = ` query getProjects($category: String!, $endcursor: String!) { projectSearch(first: 8, after: $endcursor, filter: {category: {eq: $category}}) { pageInfo { hasNextPage hasPreviousPage startCursor endCursor } edges { node { title githubUrl description liveSiteUrl id image category createdBy { id email name avatarUrl } } } } } `;…
-
I am unable to generate a schema types using codegen
0 I get an error like this when I create a my codegen.yml file. And I tried using codegen.json instead but the command "npx graphql-codegen" does not generates the code. However I have added the "generates":graphql-codegen" in my scripts in the package.json file. Below is the error I keep getting. I have tried to update…
-
Issue with Passing Variables in useSWR with graphql-request
0 I’m facing an issue while using the useSWR hook from the SWR library along with the "graphql-request" library to fetch data from my GraphQL server. The problem seems related to passing variables to the query using the useSWR hook. I have a GraphQL query defined as follows: export const GetArticleById = /* GraphQL */…
-
Why is my Apollo useLazyQuery being called unexpectedly in a React hook?
0 import { useLazyQuery } from ‘@apollo/client’; import { useEffect, useState } from ‘react’; import { ContestSessionResponseInfoObject, GetSessionDocument, HasAccessToRoundDocument, } from ‘@/graphql/generated/shikho-private-hooks’; import useQuizUserSessionStore from ‘@/store/userSessionStore’; import { calcTotalSec, isDateExpired } from ‘@/utils/helpers’; const useUserSession = (roundId: string, userId = ” as string) => { const [isLoading, setIsLoading] = useState(false); const { setUserSession, userSession, setUserSessionExpired,…
-
Error in grafbase | graphql query, working good on development but generates error on production
-1 I am creating a dribble clone where I am using grafbase for querying my data, but it generates the error on production, it says "category invalid type "null" expected to be "string", but the way I query it, it should allow null too,it working fine on development but on production side it become more…
-
Filter content by typing values in a JSX input element
0 I am working on a blog project that fetches data form a graphQl api I have a defined a BlogPosts component in which the filter function should be performed export default function Home({posts, categories}) { const [filteredPosts, setFilteredPosts] = useState(posts); const handleSearch = (filtered) => { setFilteredPosts(filtered); }; return ( <Layout categories={categories} onSearch={handleSearch}> <div…