Cannot determine a GraphQL input type for the "eq". Make sure your class is decorated with an appropriate decorator.
See original GitHub issueDescribe the bug Cursor position on object with only one attribute that leads to another nested object That lead to error: Cannot determine a GraphQL input type for the “eq”. Make sure your class is decorated with an appropriate decorator.
Have you read the Contributing Guidelines?
yes
To Reproduce Steps to reproduce the behavior:
- create
@ObjectType('PositionProfile', { })
@Schema({collection: 'positionProfile', timestamps: { createdAt: 'created', updatedAt: 'updated' } })
@CursorConnection('careerLevels', () => CareerLevel)
export class PositionProfile {
__typename?: 'PositionProfile';
@Prop()
@IDField(() => String)
_id: string;
@FilterableField()
@Prop()
profileName!: string;
@Prop({ type: [CareerLevelSchema]})
careerLevels!: Array<CareerLevel>;
and
import {Field, ObjectType} from '@nestjs/graphql';
import {Id, IdSchema} from '../id/id.model';
import {Prop, Schema, SchemaFactory} from '@nestjs/mongoose';
import {FilterableField} from '@nestjs-query/query-graphql';
import {Document} from 'mongoose';
@ObjectType({ })
@Schema()
export class CareerLevel {
__typename?: 'CareerLevel';
@FilterableField(_type => Id, { nullable: true })
@Prop({type: IdSchema})
id!: Id;
}
export interface CareerLevel extends Document {}
export type CareerLevelDocument = CareerLevel & Document;
export const CareerLevelSchema = SchemaFactory.createForClass(CareerLevel);
Expected behavior Not to throw that error on nested objects
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Cannot determine a GraphQL input type, while using Nestjs + ...
@xadm the input type is a class called User. I still cant see the problem. Would it be okay if you can guide...
Read more >type-graphql/Lobby - Gitter
I'm receiving CannotDetermineGraphQLTypeError: Cannot determine GraphQL input type for 'support' of 'CreateDeviceRequest' class. Does the value used as its ...
Read more >Resolvers | NestJS - A progressive Node.js framework
Most of the definitions in a GraphQL schema are object types. Each object type you define should represent a domain object that an...
Read more >Authorization | Nestjs-query - Blog
The nestjs-query graphql package exposes decorators and options to allow the ... if you can determine at that point that the user should...
Read more >graphql variable of type x was not provided - You.com
The first userID should be id instead of userID, it should also be defined as id in the Apollo server to match your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@lukasender Sadly no, ended up designing my structure differently to avoid having to use this setup all together.
Hey guys. Looks like the ManyToMany and OneToMany relations didn’t pop the relations types when you use the DTO for a custom Filter for example.
Given the DTO:
I can create a Filter using the
descriptionfield:But I can’t create a filter using the
subTasksrelation:Is there any way to ensure the relations types?