Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@Query overwrites previously defined methods #81

Open
stelcheck opened this issue May 14, 2018 · 0 comments
Open

@Query overwrites previously defined methods #81

stelcheck opened this issue May 14, 2018 · 0 comments
Labels

Comments

@stelcheck
Copy link

// @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants