// @ObjectType creates GraphQLObjectType from a class
@ObjectType()
class QueryType {
public prefix = 'Hello'
@Field() public greeting(): string {
return `${this.prefix}, world!`
}
@Field() public original(): string {
return `${this.prefix}, world!`
}
}
// @ObjectType creates GraphQLObjectType from a class
@ObjectType()
class QueryType2 {
public prefix = 'Hi'
@Field() public greeting(): string {
return `${this.prefix}, world!`
}
}
// @Schema creates GraphQLSchema from a class.
// The class should have a field annotated by @Query decorator.
@Schema()
class SchemaType {
@Query() public query1: QueryType
@Query() public query2: QueryType2
}
original remains callable, but now there are no longer any ways of calling the original greeting from QueryType.
originalremains callable, but now there are no longer any ways of calling the originalgreetingfrom QueryType.