Questions tagged [nestjs-graphql]
43 questions
0
votes
0 answers
Nestjs and GraphQL server accessible on Localhost only
I created an api using NestJs and GraphQL, exposing a GraphQL server (Apollo) with a certain port.
Everything works fine as long as I am using http://localhost:3001/graphql endpoint. As soon as I change to http://:3001/graphql the…

iiSam
- 61
- 5
0
votes
0 answers
Nestjs | GraphQL : "message": "Cannot read properties of undefined (reading 'method')"
How can I fix this error.
I just try using NestJs with GraphQL.
When I try to execute the Mutation or Query type. I get this error
Best regards
{
"errors": [
{
"message": "Cannot read properties of undefined (reading 'method')",
…

klger
- 1
0
votes
0 answers
How to define GraphQL 2D array of a custom input type?
I have a NestJS (core version 8.2.4) GraphQL input type. I am getting an error when trying to use a custom input type in a array field (doesn't happen if I change the custom input type to Object)
Caught exception: Error: Cannot determine a GraphQL…

Sagi Mann
- 2,967
- 6
- 39
- 72
0
votes
0 answers
Error [ERR_REQUIRE_ESM]: require() of ES not supported
I want to use graphql upload package in nestjs. But I am facing some error-
Here is my code-
import { GraphqlUpload, FileUpload } from "graphql-upload/GraphQLUpload.mjs";
import { createWriteStream } from 'fs';
@Mutation(() => SuccessInfo, {…

Md Ali
- 217
- 1
- 2
- 10
0
votes
0 answers
nestjs/graphql Nest can't resolve dependencies of the GraphQLModule... HttpAdapterHost at index [0]
I have two package with their own package.json
{
"name": "stock",
"dependencies": {
"@apollo/federation": "^0.37.1",
"@apollo/subgraph": "^2.1.3",
"@nestjs/apollo": "^10.0.9",
"@nestjs/axios": "^1.0.0",
"@nestjs/common":…

Ohdev
- 11
- 2
0
votes
0 answers
NestJS issue with circular dependency and undefined import
The past few days I've been studying NestJS + Graphql + Mongoose building a small project but started to find some issues due to database relationship and circular dependency. At the moment I'm able to query a patient with a list of previous…

Gabriel Brito
- 1,003
- 2
- 16
- 26
0
votes
1 answer
inject nestjs service to build context for graphql gateway server
In app.module.ts I have the following:
@Module({
imports: [
...,
GraphQLModule.forRoot({
server: {
context: getContext,
},
driver: ApolloGatewayDriver,
…

MD. Jahidul Islam
- 635
- 5
- 20
0
votes
0 answers
Is there a way to mark a field as Transient in Nestjs Graphql model files
In nestjs graphql we will be having @InputType() and @OutputType to automatically generate schema.
Is there a way to make a field as Transient as in Hibernate?

charan
- 41
- 5
0
votes
0 answers
Nested filter GraphQl solution in NestJs with @ResolveField
I need to have filter on ResolveField items with this structure.
This is my Schema First simple example:
type Product {
price: Int
categoryId: Int
metadata: ProductMetadata
}
type ProductMetadata {
field: String
language: LangEnum
…

Masoud Motallebipour
- 414
- 3
- 16
- 33
0
votes
0 answers
How can I create a NestJS graphql server with dynamic schema with respect to user?
I am using Nest JS for server and new to Graphql, I want to create a graphql server but schema defines in Graphql module in app.module. I am using schema first appraoch.
app.module
in importing Graphql Module, typepaths property defines to create…

Syed Muqeet Aqib
- 1
- 1
0
votes
0 answers
How to use nestjs @ResolveField Decorator Properly?
I am creating one nestjs graphql api. I write all function correctly. But when I need to add @ResolveField into @Resolver Decorator, I am facing one problem. Can any tell me when I need two @ResolveField in one @Resolver, then How can I add it?
Here…

Jannat
- 65
- 5
0
votes
1 answer
How to create two or more Resolve Field in Resolve Decorator in Nestjs?
I am creating one nestjs graphql api. I write all function correctly. But when I need to add @ResolveField into @Resolver Decorator, I get into one problem. Can any tell me when I need two @ResolveField in one @Resolver, then How can I add it?
Here…

Jannat
- 65
- 5
-1
votes
0 answers
Getting error of Cannot read properties of undefined (reading 'service') when using i18n translation in nestjs with graphql
i am using nest-i18n package to use localization in my project but when translating the message i get the error Cannot read properties of undefined (reading 'service')
Here is my code please help me to find out the exact error
Note:- I have tried to…

Ajeet Kumar
- 1
- 1