UPDATE: I solved the problem, but I'm not sure totally sure how. The code seems the same to me, but data is showing up now. Any new answers are still welcome!
So I have a cache updater for a mutation called createMeanings. (The mutation basically…
I want to fetch the token from async-storage but it returns a Promise of type string or undefined. Since fetchOptions is a function that returns a object of type RequestInit here is what i've tried
export const client = createClient({
url,
…
I have a nextjs application that is consuming a graphql api that is served using fastify. Here is how I'm creating a client and a Provider:
import React from "react";
import { createClient, Provider } from "urql";
export const url =…
I have a urql and fastify server that looks as follows:
import "reflect-metadata";
import "dotenv/config";
import _ from "node-env-types";
import Fastify from "fastify";
import mercurius from "mercurius";
import { buildSchema } from…
i am trying to iterate over a query that requires as variable.
The first thing i tried was doing it inside onMounted like this:
onMounted(async () => {
arrayOfObjects.value.forEach(async (object: ObjectType) => {
const { data } =…
I have setup codegen.ts as follows:
import type { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
overwrite: true,
schema: 'http://localhost:3333/graphql',
documents: 'libs/graphql/**/*.graphql',
…
I currently have the following server component at the route /app/account/page.tsx:
const AccountPage = async () => {
const username = await getViewer();
return ;
};
I expect getViewer to be run every…
I got empty object while uploading image. I follow all the step provided, but still can't make it solve. The error said "Variable "$file" got invalid value {}; Upload value invalid."
const client = createClient({
url:…
i am not able to implement urql caching in nextjs
the problem is described in the readme of this repository
https://github.com/prasoonchatterjee/urql-caching/tree/main
i tried using the documentation but it wasnt that clear to me so i uploaded a…
I have a Vue 3 project and I'm working with Composition API. I'm communicating with my backend using Urql which is a graphql library which allows me to wrap API requests as composables.
I'm new to Pinia, but after a bit of time working with Vue 2 +…
trying to add Authorization header to GraphQL requests, following instructions from https://formidable.com/open-source/urql/docs/advanced/authentication/
type AuthState = {
token:string
};
return authExchange({
addAuthToOperation:…
I'm trying to use a variable to pass in limit as an arg to my GraphQL query. I'm using urql and Strapi with its GraphQL plugin in a Next app.
I want to add a limit variable to limit the rows returned. I'll provide an example below followed by the…
I am developing a GraphQL testing tool. Let's say I have an input field where users can write down the query and click on the run button to run the query.
query Message {
messages {
user
content
}
}
subscription RealtimeMessage {
…
I'm attempting to make a mutation/query store request to a faunaDB database. I'm not sure how to format the query to prevent the error
import { mutationStore, gql } from "@urql/svelte";
import client from "../client.js";
const loginMutation = gql`
…