Questions tagged [apollo]

Apollo is a GraphQL client and cache for JavaScript, iOS (Swift) and Android.

Apollo is a flexible, fully-featured client for every platform.

Apollo is made up of a family of technologies you can incrementally add to your stack: Apollo Client to connect data to your UI, Apollo Engine for infrastructure and tooling, and Apollo Server to translate your REST API and backends into a GraphQL schema.

It has implementations for JavaScript, iOS and Android. The JavaScript client has integrations for React, Angular, Vue.js, Ember.js and more.

Apollo is fully compatible with any server that implements the GraphQL specification.

4536 questions
1
vote
0 answers

how to set expiration time for SqlNormalizedCacheFactory in apollo-kotlin client

With MemoryCacheFactory you can pass in an expiration time as an argument: MemoryCacheFactory(maxSizeBytes = 10 * 1024 * 1024, expireAfterMillis = 1000) how do i do something similar with SqlNormalizedCacheFactory?
raiden
  • 11
  • 1
1
vote
0 answers

How to hide only a field or query from appearing in apollo sandbox explorer

For example, let's say I have this Query and Type in my code and I don't want it to show _id in Apollo sandbox explorer. Please is there a way to achieve this? type Query { getUser(userId: String!): UserObject } type UserObject { _id:…
1
vote
1 answer

What is the reason for having custom headers in Hasura.io?

Why are there custom headers in hasura graphQL endpoint ? Is there any specific reason for its existence ? I have created two custom headers and tried to access the endpoint from post I was still able to access the endpoint without mentioning the…
imnotiam
  • 94
  • 8
1
vote
0 answers

KeystoneJS 6 with NextJS 13. Image Upload to Local Storage

The app backend keystone server frontend next app using Apollo Client to work GraphQL magic. It's an ecommerce store where the client can do all CRUD application in the NextJS app. The Problem Uploading an image to Keystone's local storage…
1
vote
1 answer

How does GraphQL/Apollo batch my requests if my resolvers hit multiple different REST endpoints?

I am new to GraphQL and one of the benefits I often see listed is that you can use it to batch multiple API requests together. So instead of querying a REST api for Authors (/authors) and posts (/posts) in two trips, with GQL you can do something…
Scott
  • 422
  • 1
  • 4
  • 17
1
vote
2 answers

How to implement useQuery apollo in nextjs useEffect()?

I'm using apollo to fetch data, how to achieve if the page re-rendered it will display the new data, how can I implement useQuery apollo in nextjs useEffect()? import { GET_ALL_USERS } from "@/graphql/queries" import { useQuery } from…
erwin
  • 99
  • 2
  • 9
1
vote
0 answers

mocking hook with apollo client , react testing library

i am trying to test a custom hook which is using subscribe to more of apollo client. the custom hook is fetching events and it is connected with subscription to the subscribe to more apollo client option to add more events to the cached query result…
1
vote
0 answers

iOS/Xcode 14, Apollo Upgrade from 0.40.0 to 1.0.7 - Swift Package Manager

I have an existing project using an old Apollo build(0.4.0) w/cocoapods and am trying to upgrade to 1.0.7. I followed all the steps here: https://www.apollographql.com/docs/ios/migrations/1.0/#breaking-changes using the 'SPM With Xcode project' set…
cspam
  • 2,911
  • 2
  • 23
  • 41
1
vote
1 answer

Next JS ERR_HTTP_HEADERS_SENT error after GraphQL mutation fails

So I'm using Next JS API routes and in one of such routes I'm calling a GraphQL mutation using Apollo, something like: // pages/api/foo.js import { initializeApollo } from '~/server/apollo' export default function handler(req, res) { const…
Adrian Guerrero
  • 739
  • 1
  • 8
  • 16
1
vote
0 answers

Apollo graphql how to import resolveType with builsSubgraphSchema

I am working on a Apollo based API but am running into an issue. I am using many small schemas and typedefs to keep everything divided nicely and using the buildSubgraphSchema function to merge them all for use. but it doesn't seem to be able to…
1
vote
0 answers

Error to resolve ApolloClient (Nuxt.JS 3)

I have this config on nuxt.config.ts: // https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ apollo: { autoImports: true, authType: "Bearer", authHeader: "Authorization", tokenStorage: "cookie", …
Zoey
  • 474
  • 4
  • 17
1
vote
2 answers

How to pass context value in apollo-server 4?

In apollo-server 3, I was able to set the context when creating the apollo server like this: const server = new ApolloServer({ debug: true, schema: executableSchema, context: contextFunction(secretValues), ... My contextFunction looked…
Gergő Horváth
  • 3,195
  • 4
  • 28
  • 64
1
vote
0 answers

GraphQL Federation Uploading File - This operation has been blocked as a potential Cross-Site Request Forgery (CSRF)

I try to upload images to Cloudflare R2 bucket. But when I upload a file on Client side, this file comes to Gateway successfully. After this step, it doesn't go to subgraph and gives this error on devtools; { "errors": [ { …
1
vote
1 answer

Type errors using Apollo Client in React Native typescript project

I am trying to use Apollo Client in my React Native project. I tried to generate types from the graphql API based on the official tutorial: https://www.apollographql.com/docs/react/development-testing/static-typing/ The problem is that I am using…
1
vote
1 answer

How to populate client-side schema on Apollo 3.0 using typePolicies

I'm asking this question because I wasn't able to find any ressource on the web (including SO, but also the documentation of Apollo-Client which is quite laconic on the subject), and I'm a out of solution. I've got this client-side schema : const…
1 2 3
99
100