Questions tagged [urql]

Formidable urlq GraphQL client

The Formidable Javascript GraphQL client

113 questions
9
votes
2 answers

urql useQuery's pause option doesn't freezes the request temporarily

I'm trying with the following code to execute urql useQuery only at once. But for some reason it is getting called on every re-render. As per the docs https://formidable.com/open-source/urql/docs/basics/queries/#pausing-usequery this query should be…
Ankit Balyan
  • 1,319
  • 19
  • 31
6
votes
2 answers

GraphQL: POST body missing, invalid Content-Type, or JSON object has no keys

I am trying to create a mutation but I keep getting a POST body is missing. I can log the data before urql and codegen hooks are called and I can see the data in the variables on the error, but chrome keeps imploding with a "POST body missing" error…
AndrogenAgonist
  • 244
  • 1
  • 3
  • 13
5
votes
1 answer

Is there a way to use* functions graphql from '@urql/vue' outside of vue3 setup()?

I'm trying to use @urql/vue to perform graphql queries outside of vue3 setup(), using vuex for example. On vue2 I used the apollo-client this way and it worked normally. This is to be able to carry out the reuse of queries with greater ease. But an…
5
votes
2 answers

@urql/svelte, "Function called outside component initialization" if not in onMount

I'm trying the amazing works done by https://github.com/FormidableLabs/urql/tree/master/packages/svelte-urql guys. Everything works good until today issue. I'm using the below code and it gives me this error: Error: Function called outside component…
Fred Hors
  • 3,258
  • 3
  • 25
  • 71
5
votes
1 answer

How do I update the grapqhl cache with urql upon a mutation, where the initial query response does not include the required __typename?

My situation has 4 components nested within each other in this order: Products (page), ProductList, ProductListItem, and CrossSellForm. Products executes a graphql query (using urql) as such: const productsQuery = ` query { products { …
Kyle Truong
  • 2,545
  • 8
  • 34
  • 50
4
votes
0 answers

Updating urql cache without a mutation

I'm working on a fullstack project that has a GraphQL backend and uses JWT for authentication. My access and refresh tokens are stored in the localStorage in the frontend. When a user logs out, I just clear the tokens from localStorage and I further…
4
votes
2 answers

Why is urql making request at wrong adress when I use server side rendering?

I am building my web application's frontend using NextJs. My client is running at http://localhost:3000/ and my graphql server is at http://localhost:5000/graphql. So I was creating Urql client and I want server side rendering. In my index.tsx I…
Arjun Kashyap
  • 623
  • 2
  • 10
  • 24
4
votes
0 answers

URQL + React "typeError: Cannot read property '_react' of undefined"

I'm currently working through a urql+react tutorial found here while also adding graphQL API calls to my own application. In the tutorial the following code is provided to send a query to the server and render components based on the result const…
Daniel Murphy
  • 330
  • 1
  • 2
  • 7
4
votes
3 answers

Convert ECMAScript Observable / Zen Observable to RXJS Observable

I have a spec-compliant ECMAScript Observable, specifically from the wonka library. I am trying to convert this type of observable to an rxjs 6 observable with no luck. It seems this may have been possible with rxjs 5. I have tried this: import {…
Jonathan
  • 3,893
  • 5
  • 46
  • 77
3
votes
1 answer

ReferenceError: self is not defined using React-Pixi and Next-urql

I keep getting this error when using the Next-Urql and React-Pixi. I understand that this is because React-Pixi requires WEB APIs. Server Error ReferenceError: self is not defined This error happened while generating the page. Any console logs will…
jmecs
  • 143
  • 2
  • 13
3
votes
3 answers

@urql/exchange-auth does not send token in the header

I am using urql GraphQL client in my project. After I log in, it's not adding a token in the authorization header automatically, as it should. I have to refresh the page once and then the token is set in the header. I have been through the…
Thor0o0
  • 367
  • 1
  • 4
  • 17
3
votes
3 answers

Can custom headers be set for urql?

The Github GraphQL v4 API has so-called Schema Previews where you can use new schema features - but it requires a custom Accept header. I've used the Apollo client before but I'd like to try this new app with Formidables urlq. Is there a way to set…
timbo
  • 13,244
  • 8
  • 51
  • 71
2
votes
0 answers

How to update cache with pagination AND sorting - urql, GraphQL

So I have an app with React, GraphQL and urql. I have a query that returns data (called readMeanings), and I have pagination (with a "Load more" button). The problem is this: because of my pagination, when I reverse the sorting (from DESC to ASC),…
vls9
  • 113
  • 10
2
votes
1 answer

Module not found: Can't resolve 'graphql'?

My Next.js app worked fine yesterday but today it has an error like this: error - ./node_modules/@urql/core/dist/ddbb86ae.mjs:1:0 Module not found: Can't resolve 'graphql' Import trace for requested…
Tui
  • 105
  • 1
  • 14
2
votes
0 answers

Can't upload image using react-native, GraphQL and urql

So I'm trying to send an image to our server with react native using GraphQL query and I don't know why but it always return an error : [CombinedError: [Network] Network request failed]. The query : import { graphql } from '../../gql'; import { gql,…
1
2 3 4 5 6 7 8