diff --git a/src/graphql.ts b/src/graphql.ts new file mode 100644 index 0000000..32bb1c4 --- /dev/null +++ b/src/graphql.ts @@ -0,0 +1,20 @@ + +/* + * ------------------------------------------------------- + * THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY) + * ------------------------------------------------------- + */ + +/* tslint:disable */ +/* eslint-disable */ + +export class ProfileDto { + firstName: string; + lastName: string; +} + +export abstract class IQuery { + abstract profile(): ProfileDto | Promise; +} + +type Nullable = T | null; diff --git a/src/profile/dto/index.ts b/src/profile/dto/index.ts new file mode 100644 index 0000000..e390c2c --- /dev/null +++ b/src/profile/dto/index.ts @@ -0,0 +1 @@ +export { ProfileDto } from './profile.dto.js'; diff --git a/src/profile/dto/profile.dto.ts b/src/profile/dto/profile.dto.ts new file mode 100644 index 0000000..a63dbb2 --- /dev/null +++ b/src/profile/dto/profile.dto.ts @@ -0,0 +1,10 @@ +import { Field, ObjectType } from '@nestjs/graphql'; + +@ObjectType() +export class ProfileDto { + @Field() + firstName: string; + + @Field() + lastName: string; +} diff --git a/src/profile/profile.resolver.ts b/src/profile/profile.resolver.ts index 6c603df..2dba26d 100644 --- a/src/profile/profile.resolver.ts +++ b/src/profile/profile.resolver.ts @@ -1,4 +1,13 @@ -import { Resolver } from '@nestjs/graphql'; +import { Resolver, Query } from '@nestjs/graphql'; +import { ProfileDto } from './dto/index.js'; @Resolver() -export class ProfileResolver {} +export class ProfileResolver { + @Query(() => ProfileDto) + async profile(): Promise { + return { + firstName: 'Евгений', + lastName: 'Лубяной', + }; + } +}