profile: guery profile (minimal)
This commit is contained in:
1 parent
6cd287cf78
commit
8da8c241e9
4 files changed
+42
-2
No files matched your search
@@ -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<ProfileDto>;
|
||||
}
|
||||
|
||||
type Nullable<T> = T | null;
|
||||
@@ -0,0 +1 @@
|
||||
export { ProfileDto } from './profile.dto.js';
|
||||
@@ -0,0 +1,10 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
@ObjectType()
|
||||
export class ProfileDto {
|
||||
@Field()
|
||||
firstName: string;
|
||||
|
||||
@Field()
|
||||
lastName: string;
|
||||
}
|
||||
@@ -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<ProfileDto> {
|
||||
return {
|
||||
firstName: 'Евгений',
|
||||
lastName: 'Лубяной',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user