Comments (4)
That's because this line should be importing from @urql/next
.
Changing your codegen file to be the one underneath should fix the issue at hand.
schema: https://swapi-graphql.netlify.app/.netlify/functions/index
generates:
./src/graphql/generated.ts:
documents: ./src/graphql/documents.graphql
config:
urqlImportFrom: "@urql/next"
plugins:
- typescript
- typescript-operations
- typescript-urql
The second issue here is that you are missing Suspense boundaries, so during SSR it throws and never keeps the GqlProvider
alive meaning the state is constantly renewed so changing your layout
to be the following should be the second fix.
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import GqlProvider from "./GqlProvider";
import { Suspense } from "react";
const inter = Inter({ subsets: ["latin"] });
export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body className={inter.className}>
<GqlProvider>
<Suspense>
{children}
</Suspense>
</GqlProvider>
</body>
</html>
);
}
from urql.
I'm experiencing the same issue. I tried the above solution but it didn't resolve the problem.
Strangely enough, what resolves the infinite fetch problem for me is removing export const runtime = "edge";
from my Page components. There seems to be some issue with serving pages from edge fns w/ urql
from urql.
@michaelzadra1 That sounds like a different issue
from urql.
Going to close this issue out, feel free to create a new one for the edge issue! 🙌 will need an accompanying reproduction
from urql.
Related Issues (20)
- [Network] Load failed. Requests are failing on mobile and safari (Safari on both desktop and mobile, and on mobile chrome) HOT 4
- Errors are returned before being able to redirect HOT 2
- useQuery in Nextjs Client Component should be executed from the client side HOT 3
- Passing a `Headers` object results in an error
- Possible memory leak when using multiple queries on the same page HOT 7
- requestPolicyExchange does not re-request in production HOT 3
- cacheExchange - cache.readQuery (updateQuery) can't find queries with aliased variables HOT 1
- @urql/exchange-persisted Module name, 'crypto' does not resolve to a valid URL. HOT 7
- Non RSC authExchange failing HOT 2
- Problem: @urql/exchange-graphcache updateCacheWithResult reads null after writing link in cache updater. HOT 8
- Invalidating cache in Graphcache doesn't trigger query refetch in Next.js app router HOT 2
- RFC: react native file upload support HOT 1
- Introspected schema from urql-introspection doesn't match type of exchange-graphcache HOT 1
- RFC: Graphcache strong typing HOT 3
- Graphcache: mutations with different files in parallel, results lost HOT 3
- Invalidate with a key does not produce expected result HOT 2
- RFC: Normalize embedded documents based on parent HOT 5
- Syntax Error: Unexpected token in SelectionSet HOT 1
- RFC: @urql/vue - Allow getter syntax in `useQuery` HOT 4
- RFC: Add secondary keys HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from urql.