Questions tagged [urql]

Formidable urlq GraphQL client

The Formidable Javascript GraphQL client

113 questions
1
vote
1 answer

How to determine in URQL if data is returned from cache or server

For example, I have: query { authors { id name twitterHandler } } And: query { posts { id author { id name twitterHandler } body title } } I do these requests sequentially and…
1
vote
1 answer

withUrqlClient does'nt work when activate ssr?

Here's my code , and I think I follow the next-urql instruction completely, import { withUrqlClient } from "next-urql" import { dedupExchange,cacheExchange,fetchExchange,ssrExchange } from "urql"; // import { cacheExchange } from…
Kai021195
  • 653
  • 3
  • 13
  • 26
1
vote
2 answers

Web socket problem when adding subscriptions in URQL client

I am using URQL Client with Apollo server, now I am trying to handle subscriptions on URQL client, but I can't seem to make the web socket work. Hope someone can help me thank you. I think there's a problem in client-side, not the communication…
JunKang Ng
  • 23
  • 4
1
vote
1 answer

Where should I store my JWT token and what does httpOnly mean for a cookie?

I read documentation about auth. I work on Nuxt project and my server returns a cookie HtppOnly My questions : A lot of confusion about the storing of the JWT token, some do not recommend using the localStroage I also read we can copy the token…
Rifton007
  • 291
  • 1
  • 5
  • 24
1
vote
1 answer

removing __typename field from urql query result before mutation

when querying data from a GraphQL Server, urql adds a _typename field to track the cache: { __typename "Book" name "test" description "the book" id "hPl39w4rzc2HZxkfHDyj" auther "John Doe" } I want to update this object and…
capiono
  • 2,875
  • 10
  • 40
  • 76
1
vote
1 answer

Debounce Input while performing a query in `urql` GraphQL Client in React.js

I have a double slider like https://zillow.github.io/react-slider with min & max values. It calls a query when one of the sliders changes. But since the query is huge, it takes a lot of time & I need to find a way to use debounce so that the query…
deadcoder0904
  • 7,232
  • 12
  • 66
  • 163
1
vote
0 answers

Failed to resolve import "@urql/exchange-graphcache" from "src/routes/$layout.svelte". Does the file exist?

I have a sveltekit project I have been working on, and configured graphcaching a while ago with @urql/exchange-graphcache. However i just installed a new dependency (dayjs, though i think it is irrelavant), and now it is throwing the error: Failed…
Norse
  • 628
  • 8
  • 26
1
vote
1 answer

next-auth / urql - access the access token to set Authorization header in urql client

I am using next-auth to manage JWT tokens and sessions for my next.js application. I'm also using urql as the GraphQL client. I initialise the urql client in a file as follows: import { createClient } from 'urql'; const client = createClient({ …
oldo.nicho
  • 2,149
  • 2
  • 25
  • 39
1
vote
0 answers

URQL GraphQL cache problem with relational data from dataloader

I'm implementing cursor pagination to create an infinite scroll of posts, building upon URQL's simple pagination example from the docs. It works fine, I get the posts I want with all the information I want... until the cache is invalidated by…
1
vote
0 answers

Trouble switching to urql offlineExchange; runtime error: TypeError: Cannot read property 'length' of undefined

I am attempting to switch to using the urql offlineExchange. Getting the following error: TypeError: Cannot read property 'length' of undefined ha …
ScottD
  • 64
  • 1
  • 11
1
vote
0 answers

library to handle global state as well as state fetched from the server in React

I'm building a web app that has a bunch of settings a user can change and some lists that are fetched from the server using GraphQL. If a user is logged in I want to store the settings on the database as well as the global state. If a user is not…
Tobi
  • 363
  • 5
  • 15
1
vote
1 answer

Initialize URQL for Svelte the async way (I need to split schema.json in a separate chunk)

I'm using Svelte and URQL. I'm using the svelte example in your packages folder here except I'm creating a format: 'esm' in my rollup.config.js. My Rollup is already code-splitting my final bundle in chunks when I use import('./Component.svelte') in…
Fred Hors
  • 3,258
  • 3
  • 25
  • 71
1
vote
2 answers

URQL - GraphQL how can I get response headers

I would like to read an info set in http response header when I make a query to GraphQL server. When I execute a query with urql client, I only get these infos : /** Resulting data from an [operation]{@link Operation}. */ export interface…
Mickael Lecoq
  • 211
  • 3
  • 10
1
vote
2 answers

How to do graphql subscriptions with Absinthe (Elixir) and Urql?

My idea was to build a client app using react and urql and a graphql api using elixir and absinthe but at the moment it looks as if these don't really play that well together. Is there a way to actually use the Absinthe subscriptions with any other…
0
votes
2 answers

Computed property not working when using `Object.values()`

I'm using the urql GraphQL-Client to run a bunch of queries in a component. I want to create a loading computed prop indicating if any of these queries are running. To be able to easily compute this, I wrapped the queries in an object: const gql =…
NoBullsh1t
  • 483
  • 4
  • 14