Tag: typegraphql
-
How to disable graphql playground?
0 My angular application is configured with graphql which by default enabled with playground, how to disable it? following is my package.json "dependencies": { "@nestjs/common": "^7.0.8", "@nestjs/core": "^7.0.8", "@nestjs/graphql": "^7.3.4", "@nestjs/microservices": "^7.0.8", "class-transformer": "^0.2.3", "class-validator": "^0.12.2", "graphql": "^14.0.0", "reflect-metadata": "^0.1.12", "rxjs": "^6.0.0" } and Dockerfile FROM node:16 RUN mkdir -p /testappservice/app COPY dist/apps/testappservice-container testappservice/app COPY…
-
How to properly implement GraphQL resolvers
1 I am creating a basic Graphql project. In this project I am only fetching user details. The data is stored in database. Here is the GQL schema: type User { id: ID! username: String! email: String! age: Int address : String firstname: String lastname :String } type Query { getUserById(id: ID!): User } When…
-
Input extend other input on graphql schema
2 Is it possible any input extend other input on graphql schema? example below: input PaginationInput{ pageSize: Int pageNum: Int } # // example for extending input Pagination input MyFilterInput implement_or_extend PaginationInput { attr1: String } type Query { usingMyFilter(filter: MyFilterInput): Any } Is there any way to do this? graphql typegraphql Share Improve this…
-
How can we make sure that data being fetched in one dataFetcher being available in other dataFetcher in a grapghQL java project
0 I am very new to GraphQL. Below is my init method in my Resolver public void init() { builder.type("SystemTopic", typeWiring -> typeWiring .dataFetcher("items", this::itemsConnection).dataFetcher("payloads", this::getPayloads)); } I need the data fetched in items in fetcher in payloads fetcher. The seconds fetcher payloads execution starts before items done its job. So, some required data is…
-
How To Throw Errors In Apollo Server v4?
0 thanks for looking into this. So I am trying to migrate my Apollo Server from V3 to V4, I have a resolver that type checks for an Access Token and returns it like so export class LoginResolver { @Mutation(() => AccessToken) async login( @Arg("email") email: string, @Arg("password") password: string, @Ctx() { prisma, res }:…
-
is typegraphql field generic object possible
0 Hi I am a bit of a newbie in typegraphql and graphql in general so theres a thing that i want to change but to put it simply: Current Working Code I want to change: @ObjectType() export class Game { @Field(() => Int) id: number; @Field({ nullable: true }) producedByUserName?: string; @Field({ nullable: true…
-
Unable to resolve signature of property decorator when called as an expression
8 import { isEmail, isEmpty, isPhoneNumber, Length } from "class-validator" import { Field, InputType } from "type-graphql"; @InputType() export class RegisterInput { @Field() @Length(2, 15, { message: "Username Must Be At Least 2 characters" }) username?: string; @Field() @isEmail() email?: string; @Field() @Length(1, 20) @isPhoneNumber() phoneNumber?: string; @isEmpty() password?: string } The thing is @isEmail()…
-
type-graphql doesn’t work when passing argument
0 I’m developing an API using apollo-server and type-graphql, but when I try to send an Input througth a Query or a Mutation arguments I don’t know what is happenning but I cannot get the data UserResolver.ts import { Arg, Query, Resolver } from ‘type-graphql’ import { UserModel } from ‘../dtos/models/UserModel’ import { CreateUserInput }…
-
Typegraphql field that can be generic for any custom type
0 I have a typegraphql base interface and want to be able to have object types use this class with their own relationship/attribute types. Is there a way to create a custom type that accepts any typegraphql objecttype? @InterfaceType() export abstract class BaseObjectType { @Field(type => ID) id: string; @Field() type: string; @Field() relationships?: any;…