Questions tagged [graphql-yoga]

16 questions
1
vote
0 answers

How to deal with mix of CommonJS and ECMAScript modules in 3rd party packages

I'm writing a NodeJS backend for an application. It uses graphql and graphql-yoga. The application runs fine using tsx, but when I attempt to build the application I get several instances of this error (from different .cts files in that same…
Dov Rosenberg
  • 673
  • 6
  • 20
1
vote
1 answer

nodejs ReadableStream pipeTo file with WritableStream

I'm trying to write an uploaded file in nodejs 18.12. from a ReadableStream with pipeTo to a file on the harddrive. But the following fails const fs = require('fs'); var path = __dirname + '/test.png'; const writeStream =…
Martin Cup
  • 2,399
  • 1
  • 21
  • 32
0
votes
1 answer

Is there a similar method to the `didEncounterError` from ApolloServer that I can use in GraphQL Yoga?

I'm migrating from ApolloServer to GraphQL Yoga server, and in the plugins of ApolloServer, they have the didEncounterError method which gives you access to the context, and I couldn't find something similar in the documentation of Yoga, does anyone…
0
votes
0 answers

Testing GraphQL Yoga Subscriptions with Jest is stuck and causing timeout errors

I have been trying to write some jest tests on a graphql yoga subscription but can't seem to get it to work as I keep getting timeout errors, can't seem to find what is making it timeout. My GraphQL Yoga code below: server.js import {createYoga,…
Osas
  • 35
  • 6
0
votes
0 answers

Build error - use of bitwise '|' with boolean operands

I have a project of react-native that I have created on an older version of MacBook Air about one year ago. now I have shift the same code to MacBook Pro and I want to build the app every thing work fine. but. I Yoga it says Build error - use of…
Engr.Aftab Ufaq
  • 3,356
  • 3
  • 21
  • 47
0
votes
1 answer

Pothos GraphQL error: PothosSchemaError: Ref Query has not been implemented

I'm using Pothos GraphQL to create the schema and queries for my graphQL API. I'm using Prisma as the ORM and @pothos/plugin-prisma as the plugin. When I start the graphql-yoga server, I get the error…
Hariharan
  • 29
  • 4
0
votes
0 answers

How do we disable introspection on a yoga graphql version 1.X

I wanted to turn off introspection on production environment I have tried using envelop plugins, import { useDisableIntrospection } from '@graphql-yoga/plugin-disable-introspection' however these are supported only on higher versions (2.X and 3.X)
0
votes
0 answers

Create Cookies in GraphQL-Yoga Resolvers using AWS Lambda Integration

Hi I am using the graphql-yoga integration with AWS Lambda sample from this Link I am unable to access the response object in the context function. I would like to access it in the AWS Lambda Integration so it can be passed onto the…
Nosh
  • 485
  • 7
  • 24
0
votes
0 answers

GraphQL Shield with Yoga and Modules

I've been developing a site that uses Yoga Server, and Modules, and looking at using Shield for security. However no matter what I seem to do, I can't get Shield to integrate with Yoga, and Modules. Here is my code (note I have stripped parts out…
0
votes
1 answer

How to check if graphql yoga server is running locally?

I have a pubsub service running with Redis and I need to check if GraphQL Yoga server is up and running locally before I start it. What's the best way to do it in Node.js with TypeScript? healthCheckEndpoint is set to 'live', port 4000
realplay
  • 2,078
  • 20
  • 32
0
votes
0 answers

Where can I find the API reference for graphql-yoga npm package

We have graphql-yoga documentation here. I want to check the the API reference which includes the syntax for the functions like createYoga(). I could not find the API reference, where can I find it. I am looking for a detailed API reference for all…
0
votes
1 answer

avoid calling a parent resolver if only nested resolver was called

lets say I have a simple query to get post's comments and it looks like this post(id:"123") { comments: { id, body } } currently it the graph will call postResolver and then commentsResolver but the call to postResolver is redundant…
Mortalus
  • 10,574
  • 11
  • 67
  • 117
0
votes
0 answers

Error 500 in graphql-yoga serveless deploy in vercel

I have a basic graphql-yoga server in port 4001,and i try to deploy to vercel serveless, but i have allways these error: This Serverless Function has crashed. Your connection is working correctly. Vercel is working correctly. 500:…
0
votes
2 answers

Upload file with apollo-upload-client and graphql-yoga 3.x

In the 3.x versions of graphql-yoga fileuploads use the scalar type File for queries, but apollo-upload-client uses Upload, so how can I make it work with those frameworks?
Martin Cup
  • 2,399
  • 1
  • 21
  • 32
0
votes
1 answer

How can i pass express Request and Response objects into graphql-yoga context using the createYoga function?

I want to pass the express req and res object to my context because i want to use express-sessions to do session-based-auth because the default requests from the context does not know about sessions. Here is what I have tried app.use("/graphql",…
crispengari
  • 7,901
  • 7
  • 45
  • 53
1
2