Category "apollo"

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

How to redirect in Nuxtjs when the return query of Graphql is empty

I'm very new to Nuxtjs and javascript world. The Nuxtjs project I'm working on required fetching data from Backend (Strapi) using Graphql. The goal is to make a

How to process 301 redirects with Nuxt ServerMiddleware and Apollo GraphQL

I am currently building a Vue / Nuxt app coupled with a modified Saleor installation to sell products online. As we are migrating from an existing system we ne

Ambiguos "Error: NEXUS__UNKNOWN__TYPE was already defined and imported as a type" error in nexus graphql

I'm getting the following error when using nexus to define a graphql schema with apollo-server. Error: NEXUS__UNKNOWN__TYPE was already defined and imported as

How to call a GraphQL query/mutation from an Express server backend?

My frontend is localhost:3000, and my GraphQL server is localhost:3333. I've used react-apollo to query/mutate in JSX land, but haven't made a query/mutation f