Questions tagged [urql]

Formidable urlq GraphQL client

The Formidable Javascript GraphQL client

113 questions
0
votes
0 answers

Is this a @urql/graphcache v6 breaking change not documented?

I'm opening this question because in the transition from @urql/graphcache version 4 to version 6 I noticed a breaking change which unfortunately is not fixable even using request-policy-exchange (from the advice @kitten gave me). Steps to reproduce…
Fred Hors
  • 3,258
  • 3
  • 25
  • 71
0
votes
0 answers

Update urql manually

I'm trying to replicate the apollo function writeQuery using urql I'm using urql with vue to fetch the current state of my items in the DB but I'm also using MQTT to catch events and those event are updates of my current items and I don't want to…
0
votes
1 answer

Typesafety on GraphQL query template literals in Svelte?

I'm using graphql-codegen to generate typescript types for my graphql queries in my sveltekit project. However, graphql-codegen doesn't seem to recognize queries in template literals in my svelte files. The urql docs show an example using graphql…
minnow
  • 183
  • 8
0
votes
0 answers

URQL Graphcache updateQuery with pagination

I'm using URQL to query (UserItemsQuery) a list of items, and to create new items (CreateItem). These items belong to a user. In normal circumstances, I would use updateQuery to add the newly created item that is returned from createItem to the…
PBrown
  • 57
  • 4
0
votes
0 answers

How to escape this string in a graphql query

I am using CommerceTools GraphQL custom fields, which need to be escaped strings, the graphql tooling I am using is gql and URQL's Mutation component the following query works in CT's playground. mutation AddCustomerName { updateCustomer( …
user254694
  • 1,461
  • 2
  • 23
  • 46
0
votes
1 answer

URQL Mutation, query fails, stays in fetching state

I am using the URQL mutation component but it is not working the way I would expect. Here is my component usages return ( {({ fetching, data, error, executeMutation }) => { if (error) { …
user254694
  • 1,461
  • 2
  • 23
  • 46
0
votes
1 answer

Error when I use getServerSideProps: Hydration failed because the initial UI does not match what was rendered on the server

I am using an Urql client to make a query to my graphql server. My query looks like this: const username = () => { const { t: translation } = useTranslation(["common", "profile"]); const { query, locale } = useRouter(); const username =…
jmecs
  • 143
  • 2
  • 13
0
votes
0 answers

URQL: Union type field in an un-keyable entity gets wrong typename from the union

So I have this fragment fragment fullOption on Option { selectId type options { ... on NumberArray { values } ... on CustomNumberArray { id name values } } } All of the Option, NumberArray and…
gk32001
  • 1
  • 1
0
votes
0 answers

Urql Client | Made updater function in cacheExchange but cache is not updating

I have made the small application using nextjs for frontend and a separate backend for requesting the data using apollo server. My NavBar component is not displaying user after i am loggedin("/login") and redirected to the homePage("/"). I have…
Napttic
  • 1
  • 2
0
votes
1 answer

Duplication on cache update in urql - urql, GraphQL, React

UPDATE: I investigated how new records are being cached, and I found that: On the first insert (new1), it adds an extra record to the current (first used) query (default query: [new1,...], first used: [new1,new1,...]). On the second insert, it…
vls9
  • 113
  • 10
0
votes
1 answer

How to set authentication using following code in which I am using urql as client to fetch GraphQL APIs

const client = new Client({ url: senseopsHTTPServerURL, exchanges: [ cacheExchange, authExchange(async utils =>{ let token = initializeAuthState(); return{ addAuthToOperation(operation){ if(!token) return…
Harshad BB
  • 99
  • 1
  • 8
0
votes
0 answers

Vue: How to re-use (fragment) types generated by graphql-codegen, typescript-operations and typescript-vue-urql?

I'm using typescript-vue-urql to generate some awesome composition functions for my graphql queries. This is my codegen.ts const config: CodegenConfig = { schema: "https://myschema.com", documents: ["**/*.graphql"], ignoreNoDocuments: true, …
TdeBooij
  • 212
  • 1
  • 2
  • 6
0
votes
0 answers

React js Graphql: Can't reproduce urql authentication flow on tests

I'm trying to follow the authentication guide of the urql documentation. Lets start with minimal context: I have a react app and a graphql server. We are introducing the refresh token feature and I'm implementing on the web client the refresh token…
Wolgan Ens
  • 385
  • 1
  • 11
0
votes
1 answer

useState doesn't update entire page - React, GraphQL, urql

I have a page which displays one record from the database. I'm using React, GraphQL, TypeScript and urql. There are two buttons, "previous" and "next." I use the createdAt field as the cursor and I change the input using React's useState (see…
vls9
  • 113
  • 10
0
votes
0 answers

HTTP headers to urql

I can't add HTTP headers to urql query to graphql on ts This need, as I know, adding options to client in App.tsx , but I don't know how that works This need, as I know, adding options to client in App.tsx , but I don't know how that works Who know…