Category "apollo"

How to use Apollo/Graphql hooks within external React.js component library

I have 3 React.js projects and I'm trying to consolidate the reused components across all 3 projects into one shared component library. This component library i

GraphQL: unexpected variables in variableValues: first when using no variables in args

My GraphQL Query works just fine in Hasura Client but fails to work when I use the query in my React code using Apollo, I don't understand why because I am not

Next.js: React Apollo Client Not sending cookies?

I'm using Apollo Client as a graphql client on my next.js application, Here is the function that creates a client for me: let client: ApolloClient<any>;

Generate GraphQL schema from TypeScript?

I have just recently started with Apollo and would like to expose some existing REST APIs through a new GraphQL layer. These REST services are already fully (Re

GraphQL: TypeError: Cannot read property of undefined

I have an Apollo GraphQL projects where I have created my own Query and Mutations. I have done using mock data and Query and Mutation works fine. But when I am

Can I create multiple elements of the same type using Strapi and GraphQL?

Can I create multiple elements of the same type using Strapi and GraphQL? For example - createMultipleFoo mutation(data: [ nameOfFoo: "ooaoaoa", weightO

How can I configure Apollo to always ignore its cache and fetch directly from the GraphQL server?

I am developing a React UI that makes use of a GraphQL API I have written (using Hot Chocolate and ASP.NET 6.0). I have just started coding the UI project and a

UnhandledPromiseRejectionWarning: Error: You must `await server.start()` before calling `server.applyMiddleware()` at ApolloServer

I am trying to start my nestJs server and It keeps giving me this error: UnhandledPromiseRejectionWarning: Error: You must await server.start() before calling s

How to generate the Apollo sha256 hash?

I need to generate the sha256 string from a graphql query - without Apollo. Assuming my query looks something like: query Foo { bar { test } bar2 } H

How to pass multiple headers in Apollo GraphQI?

I wanted to know how to pass multiple headers in Apollo GraphQl as i know how to pass single but not multiple headers.Any solutions or suggestions appreciated.T

Why does batching with a dataloader not work in a test?

Problem I am trying to test the performance of the following query: query { classes { teachers { user_id } } } When I start up my server and

RESTDataSource - How to know if response comes from get request or cache

I need to get some data from a REST API in my GraphQL API. For that I'm extending RESTDataSource from apollo-datasource-rest. From what I understood, RESTDataSo

Return ENUM - Cannot return null for non-nullable field

I am using apollo-server-lambda, Prisma ORM and graphql-codegen. I have a query (getBookById) that returns a Book. Book contains an enum called BookStatus. I wa

What is the difference between useQuery and useLazyQuery in Apollo graphQL?

I was going through the documentation of Apollo React hooks. And saw there are two queries hooks to use for which is useQuery and useLazyQuery I was reading thi

Error: Cannot find module 'graphql/validation/rules/KnownArgumentNamesRule'

When I run the command apollo client:codegen the following error comes up : Error: Cannot find module 'graphql/validation/rules/KnownArgumentNamesRule' Requ

Why is Graphql data object only available outside the call function

I am new to graphql and react so I can't figure out why the loaded data return object is only available outside the mutation post which produced the data. Could

Document is undefined when using apollo query with next.js getServerSideProps

I am trying to use getServerSideProps to fetch a query every time this component is rendered using apollo and next.js export async function getServerSideProps(c

How to prevent re-rendering with useSubscription()?

Many of you might have heard of GraphQL. It provides QUERY and MUTATION. Also it supports SUBSCRIPTION as 100% replacement of web socket. I'm a big fan of Graph

Resolve Same Entity in Different Services

I have use-case where same entity type needs to resolved in multiple service, for example Service A has type Post type Post{ id: ID! title: String } Ser

How to refresh JWT token using Apollo and GraphQL

So we're creating a React-Native app using Apollo and GraphQL. I'm using JWT based authentication(when user logs in both an activeToken and refreshToken is crea